1
Fork 0

Fix an issue with the migration test failing intermittently.

This commit is contained in:
Bauke 2023-07-04 19:09:20 +02:00
parent 089ea3d5ab
commit 5f6cf4a6de
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import {createValue} from "@holllo/webextension-storage";
import {createValue, type Value} from "@holllo/webextension-storage";
import browser from "webextension-polyfill";
import {Data, Feature} from "./enums.js";
import {collectHideTopicsData} from "./hide-topics.js";

View File

@ -50,6 +50,7 @@ export const migrations: Array<Migration<string>> = [
await version.save();
const enabledFeatures = await fromStorage(Data.EnabledFeatures);
enabledFeatures.value.clear();
for (const [key, value] of Object.entries(data.features)) {
if (value) {
const snakeCasedKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();