Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tags now load properly on beta-3.5.19 #191

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tabmaster",
"version": "2.4.1",
"version": "2.5.5",
"description": "Gives you full control over your Steam library! Support for customizing, adding, and hiding Library Tabs.",
"scripts": {
"build": "shx rm -rf dist && rollup -c",
Expand Down Expand Up @@ -78,4 +78,4 @@
]
}
}
}
}
29 changes: 10 additions & 19 deletions src/state/TabMasterManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,26 +226,17 @@ export class TabMasterManager {
* @param storeTagLocalizationMap The store tag localization map.
*/
private storeTagReaction(storeTagLocalizationMap: StoreTagLocalizationMap) {
let tagLocalizationMap = storeTagLocalizationMap._data;
if (!tagLocalizationMap && storeTagLocalizationMap.data_) {
tagLocalizationMap = storeTagLocalizationMap.data_
}

if (tagLocalizationMap) {
const tagEntriesArray = Array.from(tagLocalizationMap.entries());

if (tagEntriesArray[0][1].value || tagEntriesArray[0][1].value_) {
this.allStoreTags = tagEntriesArray.map(([tag, entry]) => {
return {
tag: tag,
string: entry.value ?? entry.value_
};
});
if (storeTagLocalizationMap) {
const tagEntriesArray = Array.from(storeTagLocalizationMap.entries());

this.allStoreTags = tagEntriesArray.map(([_, entry]) => {
return {
tag: entry.tagid,
string: entry.name
};
});

PythonInterop.setTags(this.allStoreTags);
} else {
LogController.error("Failed to get store tags. Both entry.value and entry.value_ were undefined");
}
PythonInterop.setTags(this.allStoreTags);
} else {
LogController.error("Failed to get store tags. Both _data and data_ were undefined");
}
Expand Down
15 changes: 3 additions & 12 deletions src/types/stores/appStore.d.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
// Types for the global appStore

type StoreTagLocalizationEntry = {
/**
* @deprecated Replaced by data_. Used before Dec 13 2023 on the stable Steam Client Channel, while it used MobX 5.x.x (now uses 6.x.x).
*/
value: string,
value_: string //? This is the string of the tag
tagid: number;
name: string;
}

type StoreTagLocalizationMap = {
/**
* @deprecated Replaced by data_. Used before Dec 13 2023 on the stable Steam Client Channel, while it used MobX 5.x.x (now uses 6.x.x).
*/
_data?: Map<number, StoreTagLocalizationEntry>
data_?: Map<number, StoreTagLocalizationEntry>
}
type StoreTagLocalizationMap = Map<number, StoreTagLocalizationEntry>;

type AppStore = {
GetAppOverviewByAppID: (appId: number) => SteamAppOverview | null;
Expand Down
Loading