complete passphrase verification - add spinner
This commit is contained in:
parent
4d94121ec6
commit
75707b4a93
5 changed files with 41 additions and 6 deletions
|
|
@ -32,7 +32,8 @@ angular.module('copayApp.controllers').controller('backupWordsController',
|
|||
}
|
||||
|
||||
self.addButton = function(word) {
|
||||
var btnhtml = '<button class="button radius tiny" style="white-space:nowrap" ' +
|
||||
var btnhtml = '<button class="button radius tiny"' +
|
||||
'ng-style="{\'background-color\':index.backgroundColor}"' +
|
||||
'data-ng-click="backupWordsC.removeButton($event)" id="_' + word + '" > ' + word + ' </button>';
|
||||
var temp = $compile(btnhtml)($scope);
|
||||
angular.element(document.getElementById('addWord')).append(temp);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ angular.module('copayApp.controllers').controller('backupController',
|
|||
|
||||
self.credentialsEncrypted = false;
|
||||
setWords(fc.getMnemonic());
|
||||
// $rootScope.$emit('Local/BackupDone');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,11 +6,19 @@ angular.module('copayApp.controllers').controller('backupPassphraseController',
|
|||
var self = this;
|
||||
var fc = profileService.focusedClient;
|
||||
self.passphraseSuccess = false;
|
||||
self.checkingPassphrase = false;
|
||||
self.error = "";
|
||||
|
||||
setWords(fc.getMnemonic());
|
||||
var words = fc.getMnemonic();
|
||||
|
||||
self.changePassphrase = function() {
|
||||
self.passphraseSuccess = false;
|
||||
$timeout(function() {
|
||||
$rootScope.$apply();
|
||||
}, 1);
|
||||
}
|
||||
|
||||
function setWords(words) {
|
||||
if (words) {
|
||||
self.mnemonicWords = words.split(/[\u3000\s]+/);
|
||||
|
|
@ -20,6 +28,9 @@ angular.module('copayApp.controllers').controller('backupPassphraseController',
|
|||
};
|
||||
|
||||
self.confirm = function() {
|
||||
self.checkingPassphrase = true;
|
||||
self.error = "";
|
||||
|
||||
var walletClient = bwcService.getClient();
|
||||
|
||||
walletClient.importFromMnemonic(words, {
|
||||
|
|
@ -27,8 +38,19 @@ angular.module('copayApp.controllers').controller('backupPassphraseController',
|
|||
passphrase: $scope.passphrase,
|
||||
account: 0,
|
||||
}, function(err) {
|
||||
if (err)
|
||||
self.checkingPassphrase = false;
|
||||
if (err) {
|
||||
self.error = err.message;
|
||||
$timeout(function() {
|
||||
$rootScope.$apply();
|
||||
}, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
self.passphraseSuccess = true;
|
||||
$timeout(function() {
|
||||
$rootScope.$apply();
|
||||
}, 1);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue