fix confirm method

This commit is contained in:
Javier 2015-11-23 12:58:04 -03:00
commit 32a1817ccb
2 changed files with 22 additions and 25 deletions

View file

@ -155,32 +155,28 @@
-->
<div ng-show="wordsC.step4">
<div class="box-notification" ng-show="wordsC.backupNoOk">
<!-- <div class="box-notification" ng-show="wordsC.backupError">
<span class="text-warning" translate>
Failed to verify backup. Please try again
</span>
</div>
</div> -->
<div class="onGoingProcess" ng-show="wordsC.checking">
<div class="onGoingProcess-content" ng-style="{'background-color':index.backgroundColor}">
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
<span translate>Verifying...</span>
</div>
</div>
<div class="row m10t m10b text-center">
<div class="row m10t m10b text-center" ng-show="!wordsC.backupError">
<div class="circle-icon">
<i class="fi-like size-48"></i>
</div>
<h5>Congratulation</h5>
<p class="text-gray p20" translate>
You backed up your new wallet. You can now restore this wallet at any time.
You backed up your new wallet. You can now restore this wallet at any time
</p>
</div>
<div class="row m10t m10b text-center" ng-show="wordsC.backupError">
<div class="circle-icon">
<i class="fi-like size-48"></i>
</div>
<h5>Backup failed</h5>
<p class="text-gray p20" translate>
Failed to verify backup. Please try again
</p>
</div>
@ -188,7 +184,7 @@
<button
ng-style="{'background-color':index.backgroundColor}"
class="button round expand"
ng-click="wordsC.confirm();"
ng-click="$root.go('walletHome');"
translate>Finish
</button>
</div>

View file

@ -15,7 +15,7 @@ angular.module('copayApp.controllers').controller('backupController',
self.deleted = false;
self.credentialsEncrypted = false;
self.selectComplete = false;
self.backupNoOk = false;
self.backupError = false;
if (fc.credentials && !fc.credentials.mnemonicEncrypted && !fc.credentials.mnemonic)
self.deleted = true;
@ -50,10 +50,7 @@ angular.module('copayApp.controllers').controller('backupController',
self.step3 = true;
self.step4 = false;
} else {
self.step1 = false;
self.step2 = false;
self.step3 = false;
self.step4 = true;
self.goToStep4();
}
$timeout(function() {
@ -62,10 +59,13 @@ angular.module('copayApp.controllers').controller('backupController',
}
self.goToStep4 = function() {
self.confirm();
self.step1 = false;
self.step2 = false;
self.step3 = false;
self.step4 = true;
$timeout(function() {
$scope.$apply();
}, 1);
@ -156,7 +156,7 @@ angular.module('copayApp.controllers').controller('backupController',
}
self.confirm = function() {
self.backupNoOk = false;
self.backupError = false;
var walletClient = bwcService.getClient();
@ -180,10 +180,12 @@ angular.module('copayApp.controllers').controller('backupController',
} catch (err) {
$log.debug('Failed to verify backup: ', err);
self.backupNoOk = true;
self.backupError = true;
$timeout(function() {
$scope.$apply();
}, 1);
return;
}
@ -193,7 +195,6 @@ angular.module('copayApp.controllers').controller('backupController',
if (lodash.isEqual(words, customWords)) {
$rootScope.$emit('Local/BackupDone');
go.walletHome();
}
}
});