From 772f3bfb354a24d346f24d39d9ed3948dcd3fdc1 Mon Sep 17 00:00:00 2001 From: Sam Cheng Hung Date: Wed, 11 Apr 2018 17:41:05 +0800 Subject: [PATCH] Update: Adds a callback for updateAllWallets --- src/js/controllers/tab-home.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 2068972ba..c5699ee0c 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -83,11 +83,9 @@ angular.module('copayApp.controllers').controller('tabHomeController', $scope.$on("$ionicView.enter", function(event, data) { $ionicNavBarDelegate.showBar(true); - updateAllWallets(); - - $timeout(function() { + updateAllWallets(function() { profileService.initBitcoinCoreDisplay(); - }, 1000); + }); addressbookService.list(function(err, ab) { if (err) $log.error(err); @@ -215,7 +213,7 @@ angular.module('copayApp.controllers').controller('tabHomeController', }) }; - var updateAllWallets = function() { + var updateAllWallets = function(cb) { var wallets = []; $scope.walletsBtc = profileService.getWallets({coin: 'btc'}); $scope.walletsBch = profileService.getWallets({coin: 'bch'}); @@ -249,6 +247,9 @@ angular.module('copayApp.controllers').controller('tabHomeController', } if (++j == i) { updateTxps(); + if (cb !== undefined) { + cb(); + } } }); });