From fa98ef37ecde9f225e5a46bc8b28548dd7592f1a Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Thu, 11 Nov 2021 23:41:08 +0100 Subject: [PATCH] Hide change password when using key connector (#1153) --- src/app/app.component.ts | 2 +- src/main/menu.main.ts | 8 ++++---- src/main/messaging.main.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index e81e1550c7..f191f51db8 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -338,7 +338,7 @@ export class AppComponent implements OnInit { let data: any; if (type === 'sync') { data = { - enableChangeMasterPass: !await this.keyConnectorService.getUsesKeyConnector(), + hideChangeMasterPass: await this.keyConnectorService.getUsesKeyConnector(), }; } else { data = { diff --git a/src/main/menu.main.ts b/src/main/menu.main.ts index d0794ffa93..e81fc0d4bd 100644 --- a/src/main/menu.main.ts +++ b/src/main/menu.main.ts @@ -75,10 +75,10 @@ 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, true); + this.updateApplicationMenuState(false, true, false); } - updateApplicationMenuState(isAuthenticated: boolean, isLocked: boolean, enableChangeMasterPass: boolean) { + updateApplicationMenuState(isAuthenticated: boolean, isLocked: boolean, hideChangeMasterPass: boolean) { if (isAuthenticated != null && isLocked != null) { this.unlockedRequiredMenuItems.forEach((mi: MenuItem) => { if (mi != null) { @@ -91,8 +91,8 @@ export class MenuMain extends BaseMenu { } } - if (enableChangeMasterPass != null && this.changeMasterPass != null) { - this.changeMasterPass.enabled = enableChangeMasterPass; + if (this.changeMasterPass != null) { + this.changeMasterPass.visible = !(hideChangeMasterPass ?? false); } if (this.menu != null) { diff --git a/src/main/messaging.main.ts b/src/main/messaging.main.ts index 9ee13a82f4..ef597019e8 100644 --- a/src/main/messaging.main.ts +++ b/src/main/messaging.main.ts @@ -33,7 +33,7 @@ export class MessagingMain { break; case 'updateAppMenu': this.main.menuMain.updateApplicationMenuState(message.isAuthenticated, message.isLocked, - message.enableChangeMasterPass); + message.hideChangeMasterPass); this.updateTrayMenu(message.isAuthenticated, message.isLocked); break; case 'minimizeOnCopy':