Skip to content

Commit

Permalink
fix: hide protections paragraph when no account or passcode exist
Browse files Browse the repository at this point in the history
  • Loading branch information
arielsvg committed Feb 15, 2021
1 parent 523feff commit aa34bfc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/assets/javascripts/directives/views/accountMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ class AccountMenuCtrl extends PureViewCtrl<unknown, AccountMenuState> {
});
}

hasProtections() {
return this.application.hasAccount() || this.application.hasPasscode();
}

private getProtectionsDisabledUntil(): string | null {
const protectionExpiry = this.application.getProtectionSessionExpiryDate();
const now = new Date();
Expand Down
2 changes: 1 addition & 1 deletion app/assets/templates/directives/account-menu.pug
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down

0 comments on commit aa34bfc

Please sign in to comment.