Skip to content

Commit

Permalink
Merge pull request #191 from Tormak9970/dev
Browse files Browse the repository at this point in the history
fix: tags now load properly on beta-3.5.19
  • Loading branch information
Tormak9970 authored Jun 24, 2024
2 parents 47f9da8 + 06a005e commit e2583ab
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 32 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
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

0 comments on commit e2583ab

Please sign in to comment.