Skip to content

Commit

Permalink
nightmode: Fix automatic night mode handling from outdated tabs (hone…
Browse files Browse the repository at this point in the history
  • Loading branch information
larsjohnsen authored and erikdesjardins committed Apr 29, 2018
1 parent 59fdf3c commit 4231868
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/modules/nightMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ module.go = () => {
};

export function isNightModeOn(): boolean {
return Modules.isRunning(module) && module.options.nightModeOn.value;
if (!Modules.isRunning(module)) return false;
// `toggle` contains the current nightMode state
return toggle ? toggle.enabled : module.options.nightModeOn.value;
}

export async function isNightmodeCompatible(): Promise<boolean> {
Expand Down

0 comments on commit 4231868

Please sign in to comment.