diff --git a/app/assets/javascripts/app/directives/views/accountMenu.js b/app/assets/javascripts/app/directives/views/accountMenu.js index 617e48343..d24684515 100644 --- a/app/assets/javascripts/app/directives/views/accountMenu.js +++ b/app/assets/javascripts/app/directives/views/accountMenu.js @@ -66,6 +66,7 @@ class AccountMenu { syncManager.lockSyncing(); $scope.formData.status = "Generating Login Keys..."; + $scope.formData.authenticating = true; $timeout(function(){ authManager.login($scope.formData.url, $scope.formData.email, $scope.formData.user_password, $scope.formData.ephemeral, $scope.formData.strictSignin, extraParams).then((response) => { @@ -88,6 +89,8 @@ class AccountMenu { $scope.formData.mfa = null; if(error.message) { alert(error.message); } } + + $scope.formData.authenticating = false; } // Success else { @@ -110,6 +113,7 @@ class AccountMenu { $scope.formData.confirmPassword = false; $scope.formData.status = "Generating Account Keys..."; + $scope.formData.authenticating = true; $timeout(function(){ authManager.register($scope.formData.url, $scope.formData.email, $scope.formData.user_password, $scope.formData.ephemeral).then((response) => { @@ -117,6 +121,7 @@ class AccountMenu { if(!response || response.error) { $scope.formData.status = null; var error = response ? response.error : {message: "An unknown error occured."} + $scope.formData.authenticating = false; alert(error.message); } else { $scope.onAuthSuccess(() => { @@ -139,6 +144,7 @@ class AccountMenu { $scope.onAuthSuccess = function(callback) { var block = function() { $timeout(function(){ + $scope.formData.authenticating = false; $scope.onSuccessfulAuth()(); syncManager.refreshErroredItems(); callback && callback(); diff --git a/app/assets/templates/directives/account-menu.html.haml b/app/assets/templates/directives/account-menu.html.haml index 1bc055eae..a64c6bb8a 100644 --- a/app/assets/templates/directives/account-menu.html.haml +++ b/app/assets/templates/directives/account-menu.html.haml @@ -45,7 +45,7 @@ %a{"href" => "https://standardnotes.org/help/security", "target" => "_blank"} (Learn more) .button-group.stretch.panel-row.form-submit - %button.button.info.featured{"type" => "submit"} + %button.button.info.featured{"type" => "submit", "ng-disabled" => "formData.authenticating"} .label {{formData.showLogin ? "Sign In" : "Register"}} %label diff --git a/package-lock.json b/package-lock.json index c5dad45f1..5eb5f0f6c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "standard-notes-web", - "version": "2.3.11", + "version": "2.3.13", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -8006,9 +8006,9 @@ "dev": true }, "standard-file-js": { - "version": "0.3.16", - "resolved": "https://registry.npmjs.org/standard-file-js/-/standard-file-js-0.3.16.tgz", - "integrity": "sha512-xCyEABG6+JE09A6jZJW49QczNntAtYvN3DQXMPu1PiaiFFYinBXYMmMdGKAAgH+a2T2w0UzB6mrMCjCMuz+tYw==", + "version": "0.3.17", + "resolved": "https://registry.npmjs.org/standard-file-js/-/standard-file-js-0.3.17.tgz", + "integrity": "sha512-YeX33yz19TB+JrkCWigO21Tugw6oVRi2s8m0lHG0JSOPr4UNA7ufdbzcFgQyDbh6UvF6eCevb1uezt3A3nejmQ==", "dev": true }, "static-extend": { diff --git a/package.json b/package.json index bdd41f590..46dc3664a 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "karma-jasmine": "^1.1.0", "karma-phantomjs-launcher": "^1.0.2", "sn-stylekit": "1.0.15", - "standard-file-js": "0.3.16", + "standard-file-js": "0.3.17", "sn-models": "0.1.9", "connect": "^3.6.6", "mocha": "^5.2.0",