1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +00:00

Merge pull request #1630 from vrnvorona/add-disable-badge-counter

Option to disable badge text on icon
This commit is contained in:
Chad Scharf
2021-03-12 15:23:56 -05:00
committed by GitHub
5 changed files with 41 additions and 9 deletions

View File

@@ -532,19 +532,24 @@ export default class MainBackground {
});
}
const disableBadgeCounter = await this.storageService.get<boolean>(ConstantsService.disableBadgeCounterKey);
let theText = '';
if (ciphers.length > 0 && ciphers.length <= 9) {
theText = ciphers.length.toString();
} else if (ciphers.length > 0) {
theText = '9+';
} else {
if (contextMenuEnabled) {
await this.loadNoLoginsContextMenuOptions(this.i18nService.t('noMatchingLogins'));
if (!disableBadgeCounter) {
if (ciphers.length > 0 && ciphers.length <= 9) {
theText = ciphers.length.toString();
} else if (ciphers.length > 0) {
theText = '9+';
}
}
this.browserActionSetBadgeText(theText, tabId);
if (contextMenuEnabled && ciphers.length === 0) {
await this.loadNoLoginsContextMenuOptions(this.i18nService.t('noMatchingLogins'));
}
this.sidebarActionSetBadgeText(theText, tabId);
this.browserActionSetBadgeText(theText, tabId);
return;
} catch { }
}