backup needed modal

This commit is contained in:
Gabriel Bazán 2016-09-26 13:05:15 -03:00
commit 7969a40645
7 changed files with 104 additions and 14 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);
@ -198,6 +189,7 @@ angular.module('copayApp.controllers').controller('backupController',
walletId: $stateParams.walletId,
fromOnboarding: true
});
else if ($stateParams.fromReceive) $state.go('tabs.receive');
else $state.go('tabs.preferences', {
walletId: $stateParams.walletId
});

View file

@ -71,4 +71,28 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
}, 100);
};
$scope.openBackupNeededPopup = function() {
$ionicModal.fromTemplateUrl('views/includes/backupNeededPopup.html', {
scope: $scope,
backdropClickToClose: false,
hardwareBackButtonClose: false
}).then(function(modal) {
$scope.BackupNeededPopup = modal;
$scope.BackupNeededPopup.show();
});
};
$scope.closeBackupNeededModal = function() {
$scope.BackupNeededPopup.hide();
$scope.BackupNeededPopup.remove();
};
$scope.goToBackupFlow = function() {
$scope.BackupNeededPopup.hide();
$scope.BackupNeededPopup.remove();
$state.go('tabs.receive.backup', {
fromReceive: true,
walletId: $scope.wallet.credentials.walletId
});
};
});