fix theme issue

This commit is contained in:
idk
2023-06-10 23:50:40 -04:00
parent 7ec23bfdad
commit c5148eb0c0

View File

@@ -401,6 +401,8 @@ function onThemeError(err) {
}
browser.theme.onUpdated.addListener(putCurrentThemeInLocalStorage);
browser.windows.onCreated.addListener(putCurrentThemeInLocalStorage);
browser.tabs.onCreated.addListener(putCurrentThemeInLocalStorage);
function unsetTheme() {
const storedTheme = browser.storage.local.get("theme");
@@ -413,6 +415,8 @@ function unsetTheme() {
console.warn("(theme) There's not a way to restore theme images yet.");
browser.theme.update(theme.theme);
console.log("(theme) restored the stored theme", theme);
} else {
browser.theme.reset();
}
}
restoreLatestThemeIDInLocalStorage();