Skip to content

Commit

Permalink
feat: logo positions now discard with changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tormak9970 committed May 12, 2023
1 parent 7a2ff47 commit 06fb826
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/controllers/AppController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ export class AppController {
const originalShortcuts = get(originalSteamShortcuts);
steamShortcuts.set(JSON.parse(JSON.stringify(originalShortcuts)));

const originalPositions = get(originalLogoPositions);
steamLogoPositions.set(JSON.parse(JSON.stringify(originalPositions)));

ToastController.showSuccessToast("Changes discarded!");
LogController.log("Discarded changes.");

Expand All @@ -474,9 +477,11 @@ export class AppController {
*/
static async discardChangesForGame(appId: number): Promise<void> {
const originalCache = get(originalAppLibraryCache);
const originalLogoCache = get(originalLogoPositions);
const originalShortcuts = get(originalSteamShortcuts);

const appCache = get(appLibraryCache);
const logoPositionCache = get(steamLogoPositions);
const shortcuts = get(steamShortcuts);
const platform = get(currentPlatform);

Expand All @@ -489,6 +494,9 @@ export class AppController {

appCache[appId] = originalCache[appId];
appLibraryCache.set(JSON.parse(JSON.stringify(appCache)));

logoPositionCache[appId] = originalLogoPositions[appId];
steamLogoPositions.set(JSON.parse(JSON.stringify(logoPositionCache)));

ToastController.showSuccessToast("Discarded!");
LogController.log(`Discarded changes for ${appId}.`);
Expand Down

0 comments on commit 06fb826

Please sign in to comment.