diff --git a/src/js/controller/login-existing.js b/src/js/controller/login-existing.js index e206448..9acb772 100644 --- a/src/js/controller/login-existing.js +++ b/src/js/controller/login-existing.js @@ -4,7 +4,8 @@ define(function(require) { var appController = require('js/app-controller'); var LoginExistingCtrl = function($scope, $location) { - + $scope.buttonEnabled = true; + $scope.confirmPassphrase = function() { var passphrase = $scope.passphrase, emailDao = appController._emailDao; @@ -13,6 +14,8 @@ define(function(require) { return; } + // disable button once loggin has started + $scope.buttonEnabled = false; unlockCrypto(imapLogin); function unlockCrypto(callback) { @@ -28,6 +31,7 @@ define(function(require) { function imapLogin(err) { if (err) { + $scope.buttonEnabled = true; console.error(err); return; } @@ -35,6 +39,7 @@ define(function(require) { // login to imap backend appController._emailDao.imapLogin(function(err) { if (err) { + $scope.buttonEnabled = true; console.error(err); return; } @@ -50,4 +55,4 @@ define(function(require) { }; return LoginExistingCtrl; -}); +}); \ No newline at end of file diff --git a/src/tpl/login-existing.html b/src/tpl/login-existing.html index 9989c85..101171f 100644 --- a/src/tpl/login-existing.html +++ b/src/tpl/login-existing.html @@ -14,7 +14,7 @@
- +