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-21 14:38:22 -04:00
var title = gettextCatalog . getString ( 'Without a backup, you could lose money.' ) ;
var message = gettextCatalog . getString ( 'If this device is damaged, this app is delted, or you migrate to another device, neither you nor BitPay can recover your funds.' ) ;
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 ) {
var title = gettextCatalog . getString ( 'Are you sure you want to skip the backup?' ) ;
2016-09-21 14:38:22 -04:00
var message = gettextCatalog . getString ( 'You can create a backup later from your wallet settings.' ) ;
2016-09-09 11:14:04 -03:00
var okText = gettextCatalog . getString ( 'Yes, skip backup' ) ;
var cancelText = gettextCatalog . getString ( 'Go back' ) ;
popupService . showConfirm ( title , message , okText , cancelText , function ( val ) {
if ( val ) {
2016-09-29 14:50:33 -04:00
$state . go ( 'onboarding.disclaimer' , { backedUp : false } ) ;
2016-09-09 11:14:04 -03:00
}
} ) ;
}
} ) ;
2016-08-25 16:31:47 -03:00
}
} ) ;