mirror of
https://github.com/bitwarden/browser
synced 2025-01-01 20:57:53 +01:00
Fixes for text logic
Moved settings check above setting text, also added send message when settings is changed Now when settings is changed, current tab badge is changed immediately, and other tabs do so in milliseconds after switch
This commit is contained in:
parent
2a4f71625f
commit
518722c781
@ -532,22 +532,23 @@ 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+';
|
||||
} else {
|
||||
if (contextMenuEnabled) {
|
||||
await this.loadNoLoginsContextMenuOptions(this.i18nService.t('noMatchingLogins'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const disableBadgeCounter = await this.storageService.get<boolean>(ConstantsService.disableBadgeCounterKey);
|
||||
if (!disableBadgeCounter) {
|
||||
this.sidebarActionSetBadgeText(theText, tabId);
|
||||
this.browserActionSetBadgeText(theText, tabId);
|
||||
}
|
||||
this.sidebarActionSetBadgeText(theText, tabId);
|
||||
this.browserActionSetBadgeText(theText, tabId);
|
||||
|
||||
return;
|
||||
} catch { }
|
||||
|
@ -135,6 +135,7 @@ export class OptionsComponent implements OnInit {
|
||||
async updateDisableBadgeCounter() {
|
||||
await this.storageService.save(ConstantsService.disableBadgeCounterKey, this.disableBadgeCounter);
|
||||
await this.stateService.save(ConstantsService.disableBadgeCounterKey, this.disableBadgeCounter);
|
||||
this.messagingService.send('bgUpdateContextMenu');
|
||||
}
|
||||
|
||||
async updateShowCards() {
|
||||
|
Loading…
Reference in New Issue
Block a user