Check re-scan when a new wallet focused

This commit is contained in:
Gustavo Maximiliano Cortez 2015-06-10 12:56:26 -03:00
parent 8ef15e5eae
commit d5f21e1ee0
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
2 changed files with 13 additions and 16 deletions

View File

@ -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) {

View File

@ -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');
});
});
};