1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

[Key Connector] Add support for key connector and OTP (#1135)

Co-authored-by: Hinton <oscar@oscarhinton.com>
This commit is contained in:
Thomas Rittson
2021-11-10 04:00:01 +10:00
committed by GitHub
parent aa73bde593
commit afb30d5e0b
16 changed files with 162 additions and 77 deletions

View File

@@ -75,23 +75,29 @@ export class MenuMain extends BaseMenu {
this.syncVault, this.exportVault, this.settings, this.lockNow, this.twoStepLogin, this.fingerprintPhrase,
this.changeMasterPass, this.premiumMembership, this.passwordGenerator, this.passwordHistory,
this.searchVault, this.copyUsername, this.copyPassword];
this.updateApplicationMenuState(false, true);
this.updateApplicationMenuState(false, true, true);
}
updateApplicationMenuState(isAuthenticated: boolean, isLocked: boolean) {
this.unlockedRequiredMenuItems.forEach((mi: MenuItem) => {
if (mi != null) {
mi.enabled = isAuthenticated && !isLocked;
updateApplicationMenuState(isAuthenticated: boolean, isLocked: boolean, enableChangeMasterPass: boolean) {
if (isAuthenticated != null && isLocked != null) {
this.unlockedRequiredMenuItems.forEach((mi: MenuItem) => {
if (mi != null) {
mi.enabled = isAuthenticated && !isLocked;
}
});
if (this.logOut != null) {
this.logOut.enabled = isAuthenticated;
}
});
}
if (enableChangeMasterPass != null && this.changeMasterPass != null) {
this.changeMasterPass.enabled = enableChangeMasterPass;
}
if (this.menu != null) {
Menu.setApplicationMenu(this.menu);
}
if (this.logOut != null) {
this.logOut.enabled = isAuthenticated;
}
}
private initApplicationMenu() {