From 06a005ec545cbbdba9c8b63c6c664662f6293324 Mon Sep 17 00:00:00 2001 From: Tormak <63308171+Tormak9970@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:41:48 -0500 Subject: [PATCH] fix: tags now load properly on beta-3.5.19 --- package.json | 4 ++-- src/state/TabMasterManager.tsx | 29 ++++++++++------------------- src/types/stores/appStore.d.ts | 15 +++------------ 3 files changed, 15 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index 1c062e0..d085810 100644 --- a/package.json +++ b/package.json @@ -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", @@ -78,4 +78,4 @@ ] } } -} \ No newline at end of file +} diff --git a/src/state/TabMasterManager.tsx b/src/state/TabMasterManager.tsx index d9c2ce4..a3cbac0 100644 --- a/src/state/TabMasterManager.tsx +++ b/src/state/TabMasterManager.tsx @@ -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"); } diff --git a/src/types/stores/appStore.d.ts b/src/types/stores/appStore.d.ts index 2298b8d..276ecd2 100644 --- a/src/types/stores/appStore.d.ts +++ b/src/types/stores/appStore.d.ts @@ -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 - data_?: Map -} +type StoreTagLocalizationMap = Map; type AppStore = { GetAppOverviewByAppID: (appId: number) => SteamAppOverview | null;