only needsBackup parameter in function callback

This commit is contained in:
Javier 2016-08-31 09:35:47 -03:00
commit 12b3808ade

View file

@ -41,7 +41,7 @@ angular.module('copayApp.services')
root.setBackupFlag = function(walletId) { root.setBackupFlag = function(walletId) {
storageService.setBackupFlag(walletId, function(err) { storageService.setBackupFlag(walletId, function(err) {
if (err) $log.error(err); if (err) $log.error(err);
$log.debug('Backup stored'); $log.debug('Backup flag stored');
root.wallet[walletId].needsBackup = false; root.wallet[walletId].needsBackup = false;
}); });
}; };
@ -74,22 +74,24 @@ angular.module('copayApp.services')
return false; return false;
} }
_needsBackup(wallet, function(val) { // INIT WALLET VIEWMODEL
// INIT WALLET VIEWMODEL wallet.id = walletId;
wallet.id = walletId; wallet.started = true;
wallet.started = true; wallet.doNotVerifyPayPro = isChromeApp;
wallet.doNotVerifyPayPro = isChromeApp; wallet.network = wallet.credentials.network;
wallet.network = wallet.credentials.network; wallet.copayerId = wallet.credentials.copayerId;
wallet.copayerId = wallet.credentials.copayerId; wallet.m = wallet.credentials.m;
wallet.m = wallet.credentials.m; wallet.n = wallet.credentials.n;
wallet.n = wallet.credentials.n;
wallet.needsBackup = val;
root.updateWalletSettings(wallet); root.updateWalletSettings(wallet);
root.wallet[walletId] = wallet; root.wallet[walletId] = wallet;
_needsBackup(wallet, function(val) {
wallet.needsBackup = val;
}); });
wallet.removeAllListeners(); wallet.removeAllListeners();
wallet.on('report', function(n) { wallet.on('report', function(n) {
$log.info('BWC Report:' + n); $log.info('BWC Report:' + n);
}); });