Merge pull request #321 from JDonadio/fix/clear-backup-flow-02

Reset words only - backup flow
This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-10 11:54:32 -03:00 committed by GitHub
commit 0b00274dd2
2 changed files with 7 additions and 7 deletions

View File

@ -27,7 +27,7 @@ angular.module('copayApp.controllers').controller('backupController',
}); });
}; };
$scope.initFlow = function() { $scope.setFlow = function(step) {
if (!keys) return; if (!keys) return;
var words = keys.mnemonic; var words = keys.mnemonic;
@ -39,7 +39,7 @@ angular.module('copayApp.controllers').controller('backupController',
$scope.useIdeograms = words.indexOf("\u3000") >= 0; $scope.useIdeograms = words.indexOf("\u3000") >= 0;
$scope.data.passphrase = null; $scope.data.passphrase = null;
$scope.customWords = []; $scope.customWords = [];
$scope.step = 1; $scope.step = step || 1;
$scope.selectComplete = false; $scope.selectComplete = false;
$scope.backupError = false; $scope.backupError = false;
@ -72,10 +72,10 @@ angular.module('copayApp.controllers').controller('backupController',
var showBackupResult = function() { var showBackupResult = function() {
if ($scope.backupError) { if ($scope.backupError) {
var title = gettextCatalog.getString('Uh oh...'); var title = 'Uh oh...';
var message = gettextCatalog.getString("It's important that you write your backup phrase down correctly. If something happens to your wallet, you'll need this backup to recover your money. Please review your backup and try again."); var message = gettextCatalog.getString("It's important that you write your backup phrase down correctly. If something happens to your wallet, you'll need this backup to recover your money. Please review your backup and try again.");
popupService.showAlert(title, message, function() { popupService.showAlert(title, message, function() {
$scope.goToStep(1); $scope.setFlow(2);
}) })
} else { } else {
openConfirmBackupModal(); openConfirmBackupModal();
@ -151,7 +151,7 @@ angular.module('copayApp.controllers').controller('backupController',
$scope.goToStep = function(n) { $scope.goToStep = function(n) {
if (n == 1) if (n == 1)
$scope.initFlow(); $scope.setFlow();
if (n == 2) if (n == 2)
$scope.step = 2; $scope.step = 2;
if (n == 3) { if (n == 3) {
@ -203,7 +203,7 @@ angular.module('copayApp.controllers').controller('backupController',
} }
$scope.credentialsEncrypted = false; $scope.credentialsEncrypted = false;
keys = k; keys = k;
$scope.initFlow(); $scope.setFlow();
}); });
}); });

View File

@ -51,7 +51,7 @@
</button> </button>
</span> </span>
<button ng-show="selectComplete" class="button button-standard button-primary" ng-click="goToStep(3);" translate>Confirm</button> <button ng-show="selectComplete" class="button button-standard button-primary" ng-click="goToStep(3);" translate>Confirm</button>
<button ng-show="selectComplete" class="button button-standard button-secondary button-clear" ng-click="initFlow();" translate>Clear</button> <button ng-show="selectComplete" class="button button-standard button-secondary button-clear" ng-click="setFlow(2);" translate>Clear</button>
</div> </div>
</div> </div>
</div> </div>