Skip to content

Commit

Permalink
fix theme issue
Browse files Browse the repository at this point in the history
  • Loading branch information
idk committed Jun 11, 2023
1 parent 7ec23bf commit c5148eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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();
Expand Down

0 comments on commit c5148eb

Please sign in to comment.