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 = '';
|
let theText = '';
|
||||||
if (ciphers.length > 0 && ciphers.length <= 9) {
|
|
||||||
theText = ciphers.length.toString();
|
if (!disableBadgeCounter) {
|
||||||
} else if (ciphers.length > 0) {
|
if (ciphers.length > 0 && ciphers.length <= 9) {
|
||||||
theText = '9+';
|
theText = ciphers.length.toString();
|
||||||
} else {
|
} else if (ciphers.length > 0) {
|
||||||
if (contextMenuEnabled) {
|
theText = '9+';
|
||||||
await this.loadNoLoginsContextMenuOptions(this.i18nService.t('noMatchingLogins'));
|
} else {
|
||||||
|
if (contextMenuEnabled) {
|
||||||
|
await this.loadNoLoginsContextMenuOptions(this.i18nService.t('noMatchingLogins'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const disableBadgeCounter = await this.storageService.get<boolean>(ConstantsService.disableBadgeCounterKey);
|
this.sidebarActionSetBadgeText(theText, tabId);
|
||||||
if (!disableBadgeCounter) {
|
this.browserActionSetBadgeText(theText, tabId);
|
||||||
this.sidebarActionSetBadgeText(theText, tabId);
|
|
||||||
this.browserActionSetBadgeText(theText, tabId);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} catch { }
|
} catch { }
|
||||||
|
|
|
@ -135,6 +135,7 @@ export class OptionsComponent implements OnInit {
|
||||||
async updateDisableBadgeCounter() {
|
async updateDisableBadgeCounter() {
|
||||||
await this.storageService.save(ConstantsService.disableBadgeCounterKey, this.disableBadgeCounter);
|
await this.storageService.save(ConstantsService.disableBadgeCounterKey, this.disableBadgeCounter);
|
||||||
await this.stateService.save(ConstantsService.disableBadgeCounterKey, this.disableBadgeCounter);
|
await this.stateService.save(ConstantsService.disableBadgeCounterKey, this.disableBadgeCounter);
|
||||||
|
this.messagingService.send('bgUpdateContextMenu');
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateShowCards() {
|
async updateShowCards() {
|
||||||
|
|
Loading…
Reference in New Issue