diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 6a88af443..ba414d94b 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -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) { diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index d55516589..6b8132e8e 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -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'); }); }); };