[Auto-Logout] Updated Context Menu State (#1201)
* Added context menu states * Refactored title logic Co-authored-by: Vincent Salucci <vsalucci@bitwarden.com>
This commit is contained in:
parent
02b0f15c6d
commit
a96a20e1ca
|
@ -91,6 +91,9 @@
|
|||
"vaultLocked": {
|
||||
"message": "Vault is locked."
|
||||
},
|
||||
"vaultLoggedOut": {
|
||||
"message": "Vault is logged out."
|
||||
},
|
||||
"autoFillInfo": {
|
||||
"message": "There are no logins available to auto-fill for the current browser tab."
|
||||
},
|
||||
|
|
|
@ -286,7 +286,7 @@ export default class MainBackground {
|
|||
}
|
||||
|
||||
if (forLocked) {
|
||||
await this.loadMenuAndUpdateBadgeForLockedState(!menuDisabled);
|
||||
await this.loadMenuAndUpdateBadgeForNoAccessState(!menuDisabled);
|
||||
this.onUpdatedRan = this.onReplacedRan = false;
|
||||
return;
|
||||
}
|
||||
|
@ -513,12 +513,13 @@ export default class MainBackground {
|
|||
} catch { }
|
||||
}
|
||||
|
||||
await this.loadMenuAndUpdateBadgeForLockedState(contextMenuEnabled);
|
||||
await this.loadMenuAndUpdateBadgeForNoAccessState(contextMenuEnabled);
|
||||
}
|
||||
|
||||
private async loadMenuAndUpdateBadgeForLockedState(contextMenuEnabled: boolean) {
|
||||
private async loadMenuAndUpdateBadgeForNoAccessState(contextMenuEnabled: boolean) {
|
||||
if (contextMenuEnabled) {
|
||||
await this.loadNoLoginsContextMenuOptions(this.i18nService.t('vaultLocked'));
|
||||
const authed = await this.userService.isAuthenticated();
|
||||
await this.loadNoLoginsContextMenuOptions(this.i18nService.t(authed ? 'vaultLocked' : 'vaultLoggedOut'));
|
||||
}
|
||||
|
||||
const tabs = await BrowserApi.getActiveTabs();
|
||||
|
|
Loading…
Reference in New Issue