From aa34bfc0c6a7f9dfdb05e11068f038bae9001095 Mon Sep 17 00:00:00 2001 From: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com> Date: Mon, 15 Feb 2021 16:28:36 +0100 Subject: [PATCH] fix: hide protections paragraph when no account or passcode exist --- app/assets/javascripts/directives/views/accountMenu.ts | 4 ++++ app/assets/templates/directives/account-menu.pug | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/directives/views/accountMenu.ts b/app/assets/javascripts/directives/views/accountMenu.ts index 0e31abf5d..abd423ece 100644 --- a/app/assets/javascripts/directives/views/accountMenu.ts +++ b/app/assets/javascripts/directives/views/accountMenu.ts @@ -189,6 +189,10 @@ class AccountMenuCtrl extends PureViewCtrl { }); } + hasProtections() { + return this.application.hasAccount() || this.application.hasPasscode(); + } + private getProtectionsDisabledUntil(): string | null { const protectionExpiry = this.application.getProtectionSessionExpiryDate(); const now = new Date(); diff --git a/app/assets/templates/directives/account-menu.pug b/app/assets/templates/directives/account-menu.pug index ceb885d15..1941afa56 100644 --- a/app/assets/templates/directives/account-menu.pug +++ b/app/assets/templates/directives/account-menu.pug @@ -164,7 +164,7 @@ | {{self.encryptionStatusForNotes()}} p.sk-p | {{self.state.encryptionStatusString}} - .sk-panel-section + .sk-panel-section(ng-if="self.hasProtections()") .sk-panel-section-title Protections .sk-panel-section-subtitle.info(ng-if="self.state.protectionsDisabledUntil") | Protections are disabled until {{self.state.protectionsDisabledUntil}}