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:
@@ -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 { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user