diff --git a/src/lib/category-manager.ts b/src/lib/category-manager.ts index 148ba5b450..a5cc49f15a 100644 --- a/src/lib/category-manager.ts +++ b/src/lib/category-manager.ts @@ -51,8 +51,13 @@ export class CategoryManager { let toRemove = _.union(Object.keys(userData.apps).map((x)=>steam.shortenAppId(x)),extraneousShortIds).map((x)=>+x); collections[catKey].added = collections[catKey].added.filter((appId: number) => toRemove.indexOf(appId)<0); if(collections[catKey].added.length == 0 || removeAll) { - delete collections[catKey]; cats.remove(catKey); + // weirdly this works whereas delete collections[catKey] doesn't + collections[catKey] = { + id: catKey, + added: [], + removed: [], + }; } } @@ -94,7 +99,9 @@ export class CategoryManager { }).catch((error: any)=>{ throw error; }) - .then(() => cats.save()) + .then(() => { + cats.save() + }) .then(()=>{ localConfig.UserLocalConfigStore.WebStorage['user-collections'] = JSON.stringify(collections).replace(/"/g, '\\"'); const newVDF = genericParser.stringify(localConfig); diff --git a/src/lib/vdf-manager.ts b/src/lib/vdf-manager.ts index 2dbd14bd71..099f87ecd1 100644 --- a/src/lib/vdf-manager.ts +++ b/src/lib/vdf-manager.ts @@ -269,11 +269,9 @@ export class VDF_Manager { listItem.shortcuts.removeItem(appId); listItem.addedItems.removeItem(appId); listItem.screenshots.removeItem(appId); - listItem.screenshots.removeItem(ids.shortenAppId(appId)); - listItem.screenshots.removeItem(ids.shortenAppId(appId).concat('p')); - listItem.screenshots.removeItem(ids.shortenAppId(appId).concat('_hero')); - listItem.screenshots.removeItem(ids.shortenAppId(appId).concat('_logo')); - listItem.screenshots.removeItem(ids.shortenAppId(appId).concat('_icon')); + for(let artworkType of artworkTypes) { + listItem.screenshots.removeItem(ids.shortenAppId(appId).concat(artworkIdDict[artworkType])) + } } listItem.addedItems.data = {}; });