diff --git a/js/controllers/paymentIntent.js b/js/controllers/paymentIntent.js index 9aa47f15e..846111383 100644 --- a/js/controllers/paymentIntent.js +++ b/js/controllers/paymentIntent.js @@ -10,11 +10,12 @@ angular.module('copayApp.controllers').controller('PaymentIntentController', fun _.each(wids, function(wid) { var w = $rootScope.iden.getWalletById(wid); if (w && w.isReady()) { + $scope.wallets.push(w); controllerUtils.clearBalanceCache(w); controllerUtils.updateBalance(w, function() { $rootScope.$digest(); - }); + }, true); } }); diff --git a/js/services/controllerUtils.js b/js/services/controllerUtils.js index eff844cfe..52b37c4c9 100644 --- a/js/services/controllerUtils.js +++ b/js/services/controllerUtils.js @@ -289,13 +289,13 @@ angular.module('copayApp.services') if (cb) return cb(); }; - root.updateBalance = function(w, cb) { + root.updateBalance = function(w, cb, refreshAll) { w = w || $rootScope.wallet; if (!w) return root.onErrorDigest(); if (!w.isReady()) return; w.balanceInfo = {}; - var scope = root.isFocusedWallet(w.id) ? $rootScope : w.balanceInfo; + var scope = root.isFocusedWallet(w.id) && !refreshAll ? $rootScope : w.balanceInfo; root.updateAddressList(); @@ -303,7 +303,7 @@ angular.module('copayApp.services') if (_balanceCache[wid]) { root._updateScope(w, _balanceCache[wid], scope, function() { - if (root.isFocusedWallet(w.id)) { + if (root.isFocusedWallet(w.id) && !refreshAll) { setTimeout(function() { $rootScope.$digest(); }, 1);