Remove html from popup messages. Refresh view after card or account removal. Remove old code in tab-settings ctrl.

This commit is contained in:
Andy Phillipson 2017-02-22 12:16:38 -05:00
commit efd92f5d4a
3 changed files with 11 additions and 18 deletions

View file

@ -5,7 +5,7 @@ angular.module('copayApp.controllers').controller('preferencesBitpayServicesCont
$scope.removeAccount = function(account) { $scope.removeAccount = function(account) {
var title = gettextCatalog.getString('Remove BitPay 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.<br/><br/>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 email: account.email
}); });
popupService.showConfirm(title, msg, null, null, function(res) { popupService.showConfirm(title, msg, null, null, function(res) {
@ -64,6 +64,9 @@ angular.module('copayApp.controllers').controller('preferencesBitpayServicesCont
if (cb) { if (cb) {
cb(); cb();
} }
$timeout(function(){
$rootScope.$apply();
}, 10);
}); });
}); });
}; };

View file

@ -16,27 +16,17 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
isoCode: config.wallet.settings.alternativeIsoCode isoCode: config.wallet.settings.alternativeIsoCode
}; };
$scope.bitpayCardEnabled = config.bitpayCard.enabled; // TODO move this to a generic service
$scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp;
bitpayAccountService.getAccounts(function(err, data) { bitpayAccountService.getAccounts(function(err, data) {
if (err) $log.error(err); if (err) $log.error(err);
$scope.bitpayAccounts = !lodash.isEmpty(data); $scope.bitpayAccounts = !lodash.isEmpty(data);
}); });
if ($scope.bitpayCardEnabled) { // TODO move this to a generic service
bitpayCardService.getCards(function(err, cards) { bitpayCardService.getCards(function(err, cards) {
if (err) $log.error(err); if (err) $log.error(err);
$scope.bitpayCards = cards && cards.length > 0; $scope.bitpayCards = cards && cards.length > 0;
}); });
}
if ($scope.glideraEnabled) {
storageService.getGlideraToken(glideraService.getEnvironment(), function(err, token) {
if (err) $log.error(err);
$scope.glideraToken = token;
});
}
}); });
}; };

View file

@ -68,7 +68,7 @@ angular.module('copayApp.services').factory('bitpayAccountService', function($lo
var title = gettextCatalog.getString('Add BitPay Account?'); var title = gettextCatalog.getString('Add BitPay Account?');
var msgDetail = 'Add this BitPay account ({{email}})?'; var msgDetail = 'Add this BitPay account ({{email}})?';
if (pairingReason) { if (pairingReason) {
msgDetail = 'To {{reason}} you must first add your BitPay account.<br/><br/>{{email}}'; msgDetail = 'To {{reason}} you must first add your BitPay account - {{email}}';
} }
var msg = gettextCatalog.getString(msgDetail, { var msg = gettextCatalog.getString(msgDetail, {
reason: pairingReason, reason: pairingReason,