Skip to content

Commit a1e8ab6

Browse files
committed
Fix initial status check
1 parent 37c46af commit a1e8ab6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/background/browserAction.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const twitchUrlRegexp = /^https:\/\/www.twitch.tv\/*/;
2323
let isEnabled = true;
2424

2525
browser.storage.local.get().then((currentState) => {
26-
isEnabled = !!currentState.isEnabled;
26+
isEnabled = typeof currentState.isEnabled === 'boolean' ? currentState.isEnabled : true;
2727
if (!isEnabled) {
2828
browser.browserAction.setIcon({ path: iconsDisabled });
2929
}
@@ -50,12 +50,10 @@ function emitStatus(tabId, isEnabled) {
5050

5151
function lockForTab(tabId) {
5252
browser.browserAction.disable(tabId);
53-
browser.browserAction.setIcon({ path: iconsDisabled, tabId });
5453
}
5554

5655
function unlockForTab(tabId) {
5756
browser.browserAction.enable(tabId);
58-
browser.browserAction.setIcon({ path: iconsEnabled, tabId });
5957
}
6058

6159
browser.storage.onChanged.addListener((changes, areaName) => {

0 commit comments

Comments
 (0)