add backup warning view to backup flow

This commit is contained in:
Gabriel Bazán 2016-09-26 16:11:45 -03:00
commit 33c7e2b297
17 changed files with 123 additions and 72 deletions

View file

@ -38,6 +38,22 @@ angular.module('copayApp.services')
});
}
root.setBackupNeededModalFlag = function(walletId) {
storageService.setBackupNeededModalFlag(walletId, true, function(err) {
if (err) $log.error(err);
$log.debug('Backup warning modal flag stored');
root.wallet[walletId].showBackupNeededModal = false;
});
};
function _showBackupNeededModal(wallet, cb) {
storageService.getBackupNeededModalFlag(wallet.credentials.walletId, function(err, val) {
if (err) $log.error(err);
if (val) return cb(false);
return cb(true);
});
};
root.setBackupFlag = function(walletId) {
storageService.setBackupFlag(walletId, function(err) {
if (err) $log.error(err);
@ -101,6 +117,10 @@ angular.module('copayApp.services')
wallet.balanceHidden = val;
});
_showBackupNeededModal(wallet, function(val) {
wallet.showBackupNeededModal = val;
});
wallet.removeAllListeners();
wallet.on('report', function(n) {

View file

@ -365,6 +365,14 @@ angular.module('copayApp.services')
storage.get('receiveTips', cb);
};
root.setBackupNeededModalFlag = function(walletId, val, cb) {
storage.set('showBackupNeededModal-' + walletId, val, cb);
};
root.getBackupNeededModalFlag = function(walletId, cb) {
storage.get('showBackupNeededModal-' + walletId, cb);
};
root.setAmazonGiftCards = function(network, gcs, cb) {
storage.set('amazonGiftCards-' + network, gcs, cb);
};