mirror of https://github.com/BTCPrivate/copay.git
Check re-scan when a new wallet focused
This commit is contained in:
parent
8ef15e5eae
commit
d5f21e1ee0
|
@ -625,21 +625,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
storageService.setCleanAndScanAddresses(function() {});
|
||||
});
|
||||
|
||||
$rootScope.$on('Local/CleanAndScanAddresses', function(event) {
|
||||
storageService.getCleanAndScanAddresses(function(err, val) {
|
||||
if (val) {
|
||||
$log.debug('Clear last address cache and Scan');
|
||||
var wallets = profileService.walletClients;
|
||||
for (var walletId in wallets) {
|
||||
storageService.clearLastAddress(walletId, function(err) {
|
||||
self.startScan(walletId);
|
||||
});
|
||||
}
|
||||
storageService.removeCleanAndScanAddresses(function() {});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$rootScope.$on('Local/WalletCompleted', function(event) {
|
||||
self.setFocusedWallet();
|
||||
go.walletHome();
|
||||
|
@ -783,6 +768,19 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
self.setFocusedWallet();
|
||||
self.updateTxHistory();
|
||||
go.walletHome();
|
||||
storageService.getCleanAndScanAddresses(function(err, val) {
|
||||
if (val) {
|
||||
$log.debug('Clear last address cache and Scan');
|
||||
var wallets = profileService.walletClients;
|
||||
for (var walletId in wallets) {
|
||||
storageService.clearLastAddress(walletId, function(err) {
|
||||
self.startScan(walletId);
|
||||
});
|
||||
}
|
||||
storageService.removeCleanAndScanAddresses(function() {});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$rootScope.$on('Local/SetTab', function(event, tab, reset) {
|
||||
|
|
|
@ -130,7 +130,6 @@ angular.module('copayApp.services')
|
|||
storageService.getFocusedWalletId(function(err, focusedWalletId) {
|
||||
if (err) return cb(err);
|
||||
root._setFocus(focusedWalletId, cb);
|
||||
$rootScope.$emit('Local/CleanAndScanAddresses');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue