diff --git a/app/assets/javascripts/app/directives/views/accountMenu.js b/app/assets/javascripts/app/directives/views/accountMenu.js index c561c0214..dad9c0525 100644 --- a/app/assets/javascripts/app/directives/views/accountMenu.js +++ b/app/assets/javascripts/app/directives/views/accountMenu.js @@ -26,6 +26,8 @@ class AccountMenu { return authManager.user || passcodeManager.hasPasscode(); } + $scope.canAddPasscode = !authManager.isEphemeralSession(); + $scope.syncStatus = syncManager.syncStatus; $scope.newPasswordData = {}; diff --git a/app/assets/javascripts/app/services/storageManager.js b/app/assets/javascripts/app/services/storageManager.js index e1aa26c4f..83441e67f 100644 --- a/app/assets/javascripts/app/services/storageManager.js +++ b/app/assets/javascripts/app/services/storageManager.js @@ -73,7 +73,10 @@ class StorageManager { } this.itemsStorageMode = mode; - this.storage.clear(); + if(newStorage !== this.storage) { + // Only clear if this.storage isn't the same reference as newStorage + this.storage.clear(); + } this.storage = newStorage; if(mode == StorageManager.FixedEncrypted) { diff --git a/app/assets/templates/directives/account-menu.html.haml b/app/assets/templates/directives/account-menu.html.haml index 2b188ce75..12129291a 100644 --- a/app/assets/templates/directives/account-menu.html.haml +++ b/app/assets/templates/directives/account-menu.html.haml @@ -128,11 +128,15 @@ .panel-section %h3.title.panel-row Passcode Lock %div{"ng-if" => "!hasPasscode()"} - .panel-row{"ng-if" => "!formData.showPasscodeForm"} - .button.info{"ng-click" => "addPasscodeClicked(); $event.stopPropagation();"} - .label Add Passcode + %div{"ng-if" => "canAddPasscode"} + .panel-row{"ng-if" => "!formData.showPasscodeForm"} + .button.info{"ng-click" => "addPasscodeClicked(); $event.stopPropagation();"} + .label Add Passcode - %p Add an app passcode to lock the app and encrypt on-device key storage. + %p Add an app passcode to lock the app and encrypt on-device key storage. + + %div{"ng-if" => "!canAddPasscode"} + %p Adding a passcode is not supported in temporary sessions. Please sign out, then sign back in with the "Stay signed in" option checked. %form{"ng-if" => "formData.showPasscodeForm", "ng-submit" => "submitPasscodeForm()"} %input.form-control{:type => 'password', "ng-model" => "formData.passcode", "placeholder" => "Passcode", "sn-autofocus" => "true", "should-focus" => "true"}