Merge pull request #4409 from JDonadio/fix/double-scan

Remove handle imported client method
This commit is contained in:
Matias Alejo Garcia 2016-06-15 13:23:17 -03:00 committed by GitHub
commit 66506a9f8d
2 changed files with 18 additions and 34 deletions

View file

@ -1032,7 +1032,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
}); });
}; };
self.initGlidera = function(accessToken) { self.initGlidera = function(accessToken) {
self.glideraEnabled = configService.getSync().glidera.enabled; self.glideraEnabled = configService.getSync().glidera.enabled;
self.glideraTestnet = configService.getSync().glidera.testnet; self.glideraTestnet = configService.getSync().glidera.testnet;

View file

@ -176,7 +176,8 @@ angular.module('copayApp.services')
function bindWallets(cb) { function bindWallets(cb) {
var l = root.profile.credentials.length; var l = root.profile.credentials.length;
var i = 0, totalBound = 0; var i = 0,
totalBound = 0;
if (!l) return cb(); if (!l) return cb();
@ -502,22 +503,11 @@ angular.module('copayApp.services')
}); });
}; };
var handleImportedClient = function(cb) {
if (!opts.isImport) return cb();
$rootScope.$emit('Local/BackupDone', walletId);
if (!client.isComplete())
return cb();
storageService.setCleanAndScanAddresses(walletId, cb);
};
walletService.updateRemotePreferences(client, {}, function() { walletService.updateRemotePreferences(client, {}, function() {
$log.debug('Remote preferences saved for:' + walletId) $log.debug('Remote preferences saved for:' + walletId)
}); });
saveBwsUrl(function() { saveBwsUrl(function() {
handleImportedClient(function() {
root.setAndStoreFocus(walletId, function() { root.setAndStoreFocus(walletId, function() {
storageService.storeProfile(root.profile, function(err) { storageService.storeProfile(root.profile, function(err) {
@ -529,7 +519,6 @@ angular.module('copayApp.services')
}); });
}); });
});
}; };
root.storeProfileIfDirty = function(cb) { root.storeProfileIfDirty = function(cb) {
@ -563,8 +552,7 @@ angular.module('copayApp.services')
var historyCache = str.historyCache ||  []; var historyCache = str.historyCache ||  [];
root.addAndBindWalletClient(walletClient, { root.addAndBindWalletClient(walletClient, {
bwsurl: opts.bwsurl, bwsurl: opts.bwsurl
isImport: true
}, function(err, walletId) { }, function(err, walletId) {
if (err) return cb(err); if (err) return cb(err);
root.setMetaData(walletClient, addressBook, historyCache, function(error) { root.setMetaData(walletClient, addressBook, historyCache, function(error) {
@ -587,8 +575,7 @@ angular.module('copayApp.services')
} }
root.addAndBindWalletClient(walletClient, { root.addAndBindWalletClient(walletClient, {
bwsurl: opts.bwsurl, bwsurl: opts.bwsurl
isImport: true
}, cb); }, cb);
}); });
}; };
@ -619,8 +606,7 @@ angular.module('copayApp.services')
} }
root.addAndBindWalletClient(walletClient, { root.addAndBindWalletClient(walletClient, {
bwsurl: opts.bwsurl, bwsurl: opts.bwsurl
isImport: true
}, cb); }, cb);
}); });
}; };
@ -643,8 +629,7 @@ angular.module('copayApp.services')
} }
root.addAndBindWalletClient(walletClient, { root.addAndBindWalletClient(walletClient, {
bwsurl: opts.bwsurl, bwsurl: opts.bwsurl
isImport: true
}, cb); }, cb);
}); });
}; };