added conditional to show back button when no backup has been saved

This commit is contained in:
Jamal Jackson 2016-09-29 14:50:33 -04:00
commit 7f813ba396
5 changed files with 29 additions and 32 deletions

View file

@ -49,15 +49,6 @@ angular.module('copayApp.controllers').controller('backupController',
}, 10);
};
$scope.goBack = function() {
if ($scope.step == 1) {
if ($stateParams.fromOnboarding) $state.go('onboarding.backupRequest');
else $state.go('wallet.preferences');
} else {
$scope.goToStep($scope.step - 1);
}
};
var backupError = function(err) {
ongoingProcess.set('validatingWords', false);
$log.debug('Failed to verify backup: ', err);
@ -93,13 +84,15 @@ angular.module('copayApp.controllers').controller('backupController',
$scope.closeBackupResultModal = function() {
$scope.confirmBackupModal.hide();
$scope.confirmBackupModal.remove();
if ($stateParams.fromOnboarding) {
$state.go('onboarding.disclaimer');
} else {
$ionicHistory.removeBackView();
$state.go('tabs.home');
}
profileService.isDisclaimerAccepted(function(val) {
if (val) {
$ionicHistory.removeBackView();
$state.go('tabs.home');
}
else $state.go('onboarding.disclaimer', {backedUp: false});
});
};
var confirm = function(cb) {
@ -193,16 +186,6 @@ angular.module('copayApp.controllers').controller('backupController',
$scope.selectComplete = false;
};
$scope.backupGoBack = function() {
if ($stateParams.fromOnboarding) $state.go('onboarding.backupWarning', {
walletId: $stateParams.walletId,
fromOnboarding: true
});
else $state.go('tabs.preferences', {
walletId: $stateParams.walletId
});
};
$scope.$on("$ionicView.enter", function(event, data) {
$scope.deleted = isDeletedSeed();
if ($scope.deleted) {
@ -222,4 +205,4 @@ angular.module('copayApp.controllers').controller('backupController',
});
});
});
});