Wallet/src/js/controllers/onboarding/backupRequest.js

39 lines
1.5 KiB
JavaScript
Raw Normal View History

2016-08-25 16:31:47 -03:00
'use strict';
angular.module('copayApp.controllers').controller('backupRequestController', function($scope, $state, $stateParams, $ionicConfig, popupService, gettextCatalog) {
2016-08-25 16:31:47 -03:00
2016-09-02 15:42:45 -03:00
$scope.walletId = $stateParams.walletId;
2016-08-25 16:31:47 -03:00
$scope.$on("$ionicView.enter", function() {
$ionicConfig.views.swipeBackEnabled(false);
});
$scope.$on("$ionicView.beforeLeave", function() {
$ionicConfig.views.swipeBackEnabled(true);
});
2016-09-09 11:14:04 -03:00
$scope.openPopup = function() {
2016-08-25 16:31:47 -03:00
2016-12-28 16:29:45 -03:00
var title = gettextCatalog.getString('Watch out!');
var message = gettextCatalog.getString('If this device is replaced or this app is deleted, neither you nor BitPay can recover your funds without a backup.');
2016-09-09 11:14:04 -03:00
var okText = gettextCatalog.getString('I understand');
var cancelText = gettextCatalog.getString('Go back');
popupService.showConfirm(title, message, okText, cancelText, function(val) {
if (val) {
2016-12-28 16:29:45 -03:00
var title = gettextCatalog.getString('Are you sure you want to skip it?');
2016-09-21 14:38:22 -04:00
var message = gettextCatalog.getString('You can create a backup later from your wallet settings.');
2016-12-28 16:29:45 -03:00
var okText = gettextCatalog.getString('Yes, skip');
2016-09-09 11:14:04 -03:00
var cancelText = gettextCatalog.getString('Go back');
popupService.showConfirm(title, message, okText, cancelText, function(val) {
if (val) {
$state.go('onboarding.disclaimer', {
walletId: $scope.walletId,
backedUp: false
});
2016-09-09 11:14:04 -03:00
}
});
}
});
2016-08-25 16:31:47 -03:00
}
});