2016-08-25 16:31:47 -03:00
'use strict' ;
2016-09-09 11:14:04 -03:00
angular . module ( 'copayApp.controllers' ) . controller ( 'backupRequestController' , function ( $scope , $state , $stateParams , $ionicPopup , 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
2016-09-09 11:14:04 -03:00
$scope . openPopup = function ( ) {
2016-08-25 16:31:47 -03:00
2016-09-09 11:14:04 -03:00
var title = gettextCatalog . getString ( 'Without a backup, you could lose money' ) ;
var message = gettextCatalog . getString ( 'If something happens to this device, this app is deleted, or your password forgotten, neither you nor Bitpay can recover your funds' ) ;
var okText = gettextCatalog . getString ( 'I understand' ) ;
var cancelText = gettextCatalog . getString ( 'Go back' ) ;
popupService . showConfirm ( title , message , okText , cancelText , function ( val ) {
if ( val ) {
var title = gettextCatalog . getString ( 'Are you sure you want to skip the backup?' ) ;
var message = gettextCatalog . getString ( 'You can create a backup later from your wallet settings' ) ;
var okText = gettextCatalog . getString ( 'Yes, skip backup' ) ;
var cancelText = gettextCatalog . getString ( 'Go back' ) ;
popupService . showConfirm ( title , message , okText , cancelText , function ( val ) {
if ( val ) {
$state . go ( 'onboarding.disclaimer' ) ;
}
} ) ;
}
} ) ;
2016-08-25 16:31:47 -03:00
}
} ) ;