Auto submit passcode form

This commit is contained in:
Mo Bitar
2017-10-16 10:18:27 -05:00
parent 5987ac1aa4
commit 5576851da9
2 changed files with 8 additions and 5 deletions

View File

@@ -512,9 +512,12 @@ class AccountMenu {
$scope.formData.showPasscodeForm = false; $scope.formData.showPasscodeForm = false;
var offline = authManager.offline(); var offline = authManager.offline();
var message = "You've succesfully set an app passcode."; // Allow UI to update before showing alert
if(offline) { message += " Your items will now be encrypted using this passcode."; } setTimeout(function () {
alert(message); var message = "You've succesfully set an app passcode.";
if(offline) { message += " Your items will now be encrypted using this passcode."; }
alert(message);
}, 10);
if(offline) { if(offline) {
syncManager.markAllItemsDirtyAndSaveOffline(); syncManager.markAllItemsDirtyAndSaveOffline();

View File

@@ -124,11 +124,11 @@
%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.
%a.block.mt-5{"ng-click" => "addPasscodeClicked()", "ng-if" => "!formData.showPasscodeForm"} Add Passcode %a.block.mt-5{"ng-click" => "addPasscodeClicked()", "ng-if" => "!formData.showPasscodeForm"} Add Passcode
.mt-5{"ng-if" => "formData.showPasscodeForm"} %form.mt-5{"ng-if" => "formData.showPasscodeForm", "ng-submit" => "submitPasscodeForm()"}
%p.bold Choose a passcode: %p.bold Choose a passcode:
%input.form-control.mt-10{:type => 'password', "ng-model" => "formData.passcode", "placeholder" => "Passcode", "autofocus" => "true"} %input.form-control.mt-10{:type => 'password', "ng-model" => "formData.passcode", "placeholder" => "Passcode", "autofocus" => "true"}
%input.form-control.mt-10{:type => 'password', "ng-model" => "formData.confirmPasscode", "placeholder" => "Confirm Passcode"} %input.form-control.mt-10{:type => 'password', "ng-model" => "formData.confirmPasscode", "placeholder" => "Confirm Passcode"}
%button.standard.ui-button.block.tinted.mt-5{"ng-click" => "submitPasscodeForm()"} Set Passcode %button.standard.ui-button.block.tinted.mt-5{"type" => "submit"} Set Passcode
%div{"ng-if" => "hasPasscode()"} %div{"ng-if" => "hasPasscode()"}
%p %p
Passcode lock is enabled. Passcode lock is enabled.