Skip to content

Commit

Permalink
refactor: code housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
ellielle committed Aug 2, 2023
1 parent d703456 commit f51278a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/background/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ runtime.onStartup.addListener(async (): Promise<void> => {
});

action.onClicked.addListener(async (tab): Promise<void> => {
if (tab.url && tab.url.includes("guildwars2") && isDark) {
toggleDarkMode(!isDark.value);
if (tab.url && tab.url.includes("guildwars2")) {
toggleDarkMode(!isDark.value ?? true);
}
});
4 changes: 2 additions & 2 deletions src/contentScripts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function removeDarkMode() {
onMessage("dark-mode-toggle", ({ data }) => {
if (!data.dark) {
removeDarkMode();
} else if (data.dark) {
loadDarkMode();
return;
}
loadDarkMode();
});

0 comments on commit f51278a

Please sign in to comment.