Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fix #2569, put in a different icon when the user is not yet onboarded
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb committed Apr 6, 2017
1 parent db23e98 commit f6fb476
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion addon/webextension/background/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ window.main = (function () {

browser.storage.local.get(["hasSeenOnboarding"]).then((result) => {
hasSeenOnboarding = !! result.hasSeenOnboarding;
if (! hasSeenOnboarding) {
setIconActive(false, null);
}
}).catch((error) => {
console.error("Error getting hasSeenOnboarding:", error);
});
Expand All @@ -35,7 +38,10 @@ window.main = (function () {
}

function setIconActive(active, tabId) {
const path = active ? "icons/icon-highlight-38.png" : "icons/icon-38.png";
let path = active ? "icons/icon-highlight-38.png" : "icons/icon-38.png";
if ((! hasSeenOnboarding) && ! active) {
path = "icons/icon-38-starred.png";
}
browser.browserAction.setIcon({path, tabId});
}

Expand Down Expand Up @@ -178,6 +184,7 @@ window.main = (function () {
communication.register("hasSeenOnboarding", () => {
hasSeenOnboarding = true;
catcher.watchPromise(browser.storage.local.set({hasSeenOnboarding}));
setIconActive(false, null);
});

return exports;
Expand Down
Binary file added addon/webextension/icons/icon-38-starred.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f6fb476

Please sign in to comment.