From 801ba54d46501d9872f04fa65860ff7f62bbc16f Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Wed, 22 Feb 2017 12:34:19 -0500 Subject: [PATCH] Ensure settings view is updated when changes made to cards and accounts. --- src/js/controllers/tab-settings.js | 10 +++++++++- www/views/tab-settings.html | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/tab-settings.js b/src/js/controllers/tab-settings.js index d8aa67cc7..b43dfb4ad 100644 --- a/src/js/controllers/tab-settings.js +++ b/src/js/controllers/tab-settings.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, appConfigService, $ionicModal, $log, lodash, uxLanguage, platformInfo, profileService, feeService, configService, externalLinkService, bitpayAccountService, bitpayCardService, storageService, glideraService, gettextCatalog, buyAndSellService) { +angular.module('copayApp.controllers').controller('tabSettingsController', function($rootScope, $timeout, $scope, appConfigService, $ionicModal, $log, lodash, uxLanguage, platformInfo, profileService, feeService, configService, externalLinkService, bitpayAccountService, bitpayCardService, storageService, glideraService, gettextCatalog, buyAndSellService) { var updateConfig = function() { $scope.currentLanguageName = uxLanguage.getCurrentLanguageName(); @@ -20,12 +20,20 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct bitpayAccountService.getAccounts(function(err, data) { if (err) $log.error(err); $scope.bitpayAccounts = !lodash.isEmpty(data); + + $timeout(function() { + $rootScope.$apply(); + }, 10); }); // TODO move this to a generic service bitpayCardService.getCards(function(err, cards) { if (err) $log.error(err); $scope.bitpayCards = cards && cards.length > 0; + + $timeout(function() { + $rootScope.$apply(); + }, 10); }); }); }; diff --git a/www/views/tab-settings.html b/www/views/tab-settings.html index b2a9b9fc4..471b7afda 100644 --- a/www/views/tab-settings.html +++ b/www/views/tab-settings.html @@ -113,7 +113,7 @@