diff --git a/app/background/api/browserActionAPI.ts b/app/background/api/browserActionAPI.ts index 55f06ca..b6a02aa 100644 --- a/app/background/api/browserActionAPI.ts +++ b/app/background/api/browserActionAPI.ts @@ -29,9 +29,12 @@ export function init () { * Sets the badge text * @param {string} text - The text to put on the badge */ -export const setBadgeText = (text: string) => { +export const setBadgeText = (tabId: number, text: string) => { if (chrome.browserAction) { - chrome.browserAction.setBadgeText({ text: String(text) }) + chrome.browserAction.setBadgeText({ + tabId, + text: String(text) + }) } } diff --git a/app/background/reducers/shieldsPanelReducer.ts b/app/background/reducers/shieldsPanelReducer.ts index 11dfbd9..829976f 100644 --- a/app/background/reducers/shieldsPanelReducer.ts +++ b/app/background/reducers/shieldsPanelReducer.ts @@ -30,7 +30,7 @@ const updateBadgeText = (state: State) => { if (tab) { const total = tab.adsBlocked + tab.trackersBlocked + tab.javascriptBlocked + tab.fingerprintingBlocked + tab.httpsRedirected // do not show any badge if there are no blocked items - setBadgeText(total > 99 ? '99+' : total > 0 ? total.toString() : '') + setBadgeText(tabId, total > 99 ? '99+' : total > 0 ? total.toString() : '') } }