diff --git a/src/js/controllers/preferencesBitpayServices.js b/src/js/controllers/preferencesBitpayServices.js index 7ce638def..2af60532d 100644 --- a/src/js/controllers/preferencesBitpayServices.js +++ b/src/js/controllers/preferencesBitpayServices.js @@ -5,7 +5,7 @@ angular.module('copayApp.controllers').controller('preferencesBitpayServicesCont $scope.removeAccount = function(account) { var title = gettextCatalog.getString('Remove BitPay Account?'); - var msg = gettextCatalog.getString('Removing your BitPay account will remove all associated BitPay account data from this device.

Are you sure you would like to remove your BitPay Account ({{email}}) from this device?', { + var msg = gettextCatalog.getString('Removing your BitPay account will remove all associated BitPay account data from this device. Are you sure you would like to remove your BitPay Account ({{email}}) from this device?', { email: account.email }); popupService.showConfirm(title, msg, null, null, function(res) { @@ -64,6 +64,9 @@ angular.module('copayApp.controllers').controller('preferencesBitpayServicesCont if (cb) { cb(); } + $timeout(function(){ + $rootScope.$apply(); + }, 10); }); }); }; diff --git a/src/js/controllers/tab-settings.js b/src/js/controllers/tab-settings.js index a8928ab29..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(); @@ -16,27 +16,25 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct isoCode: config.wallet.settings.alternativeIsoCode }; - $scope.bitpayCardEnabled = config.bitpayCard.enabled; - $scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp; - + // TODO move this to a generic service bitpayAccountService.getAccounts(function(err, data) { if (err) $log.error(err); $scope.bitpayAccounts = !lodash.isEmpty(data); + + $timeout(function() { + $rootScope.$apply(); + }, 10); }); - if ($scope.bitpayCardEnabled) { - bitpayCardService.getCards(function(err, cards) { - if (err) $log.error(err); - $scope.bitpayCards = cards && cards.length > 0; - }); - } + // TODO move this to a generic service + bitpayCardService.getCards(function(err, cards) { + if (err) $log.error(err); + $scope.bitpayCards = cards && cards.length > 0; - if ($scope.glideraEnabled) { - storageService.getGlideraToken(glideraService.getEnvironment(), function(err, token) { - if (err) $log.error(err); - $scope.glideraToken = token; - }); - } + $timeout(function() { + $rootScope.$apply(); + }, 10); + }); }); }; diff --git a/src/js/services/bitpayAccountService.js b/src/js/services/bitpayAccountService.js index e32e84727..7ab5a1bf7 100644 --- a/src/js/services/bitpayAccountService.js +++ b/src/js/services/bitpayAccountService.js @@ -68,7 +68,7 @@ angular.module('copayApp.services').factory('bitpayAccountService', function($lo var title = gettextCatalog.getString('Add BitPay Account?'); var msgDetail = 'Add this BitPay account ({{email}})?'; if (pairingReason) { - msgDetail = 'To {{reason}} you must first add your BitPay account.

{{email}}'; + msgDetail = 'To {{reason}} you must first add your BitPay account - {{email}}'; } var msg = gettextCatalog.getString(msgDetail, { reason: pairingReason, 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 @@