Skip to content
This repository has been archived by the owner on Jun 8, 2018. It is now read-only.

Commit

Permalink
Improve menu entry title injection count logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Synzvato committed Jun 25, 2018
1 parent 75e1a86 commit 36f9884
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions core/state-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,13 @@ stateManager._updateTab = function (details) {
return;
}

if (stateManager.showIconBadge === true) {
chrome.browserAction.setTitle({
'tabId': tabIdentifier,
'title': 'Decentraleyes'
});

wrappers.setBadgeText({
'tabId': tabIdentifier,
'text': ''
});
if (stateManager.showIconBadge === true) {
stateManager._clearBadgeText(tabIdentifier);
}

if (stateManager.tabs[tabIdentifier]) {
Expand Down Expand Up @@ -170,14 +171,18 @@ stateManager._handleStorageChanged = function (changes) {
}
};

stateManager._removeIconBadgeFromTab = function (tab) {
stateManager._clearBadgeText = function (tabIdentifier) {

wrappers.setBadgeText({
'tabId': tab.id,
'tabId': tabIdentifier,
'text': ''
});
};

stateManager._removeIconBadgeFromTab = function (tab) {
stateManager._clearBadgeText(tab.id);
};

/**
* Initializations
*/
Expand Down

0 comments on commit 36f9884

Please sign in to comment.