Skip to content

Commit

Permalink
Remove removed es_guide_tags from local storage during migration
Browse files Browse the repository at this point in the history
  • Loading branch information
tfedor committed Sep 16, 2024
1 parent cff6cb7 commit 023b7df
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/js/Background/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import SteamStoreApi from "./Modules/Store/SteamStoreApi";
import ITADApi from "./Modules/IsThereAnyDeal/ITADApi";
import AugmentedSteamApi from "./Modules/AugmentedSteam/AugmentedSteamApi";
import UserNotesApi from "./Modules/UserNotes/UserNotesApi";
import browser, {type Runtime} from "webextension-polyfill";
import browser, {type Runtime, type Storage as ns} from "webextension-polyfill";
import type MessageHandlerInterface from "@Background/MessageHandlerInterface";
import InventoryApi from "@Background/Modules/Inventory/InventoryApi";
import CacheApi from "@Background/Modules/Cache/CacheApi";
Expand All @@ -14,6 +14,7 @@ import Environment, {ContextType} from "@Core/Environment";
import SettingsMigration from "@Core/Update/SettingsMigration";
import Version from "@Core/Version";
import {EAction} from "@Background/EAction";
import Storage from "@Core/Storage/Storage";

Environment.CurrentContext = ContextType.Background;

Expand All @@ -36,6 +37,16 @@ browser.runtime.onInstalled.addListener(async (detail) => {
await IndexedDB.init();
await SettingsMigration.migrate(oldVersion);
await (new CacheApi()).handle(EAction.CacheClear);

/*
* Local storage migration
* TODO remove in next minor version
*/
await (async function() {
const localStorage = new Storage<ns.LocalStorageArea, {es_guide_tags: Record<string, string[]>}>(browser.storage.local);
await localStorage.remove("es_guide_tags");
})();

console.log("Update done");
});

Expand Down

0 comments on commit 023b7df

Please sign in to comment.