From c5148eb0c03446a2916a8943eff2417c94d70c47 Mon Sep 17 00:00:00 2001 From: idk Date: Sat, 10 Jun 2023 23:50:40 -0400 Subject: [PATCH] fix theme issue --- background.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/background.js b/background.js index f2b6ec5..0f11065 100644 --- a/background.js +++ b/background.js @@ -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();