Abstract bitpayCardCredentials to appIdentity. Improve alert text on card removal.

This commit is contained in:
Andy Phillipson 2016-11-14 16:24:52 -05:00
commit 43f24ee35e
5 changed files with 87 additions and 60 deletions

View file

@ -1,5 +1,5 @@
'use strict';
angular.module('copayApp.controllers').controller('bitpayCardIntroController', function($scope, $log, $state, $ionicHistory, storageService, externalLinkService, bitpayCardService, gettextCatalog, popupService) {
angular.module('copayApp.controllers').controller('bitpayCardIntroController', function($scope, $log, $state, $ionicHistory, storageService, externalLinkService, bitpayCardService, gettextCatalog, popupService, appIdentityService) {
var checkOtp = function(obj, cb) {
if (obj.otp) {
@ -56,9 +56,9 @@ angular.module('copayApp.controllers').controller('bitpayCardIntroController', f
});
});
} else {
bitpayCardService.getCredentials(function(err, credentials) {
appIdentityService.getIdentity(bitpayCardService.getEnvironment(), function(err, appIdentity) {
if (err) popupService.showAlert(null, err);
else $log.info('BitPay Debit Card Credentials: Ok.');
else $log.info('App identity: Ok.');
});
}
});

View file

@ -4,7 +4,9 @@ angular.module('copayApp.controllers').controller('preferencesBitpayCardControll
function($scope, $state, $timeout, $ionicHistory, bitpayCardService, popupService, gettextCatalog) {
$scope.remove = function(card) {
var msg = gettextCatalog.getString('Are you sure you would like to remove your BitPay Card account from this device?');
var msg = gettextCatalog.getString('Are you sure you would like to remove your BitPay Card account ({{lastFourDigits}}) from this device?', {
lastFourDigits: card.lastFourDigits
});
popupService.showConfirm(null, msg, null, null, function(res) {
if (res) remove(card);
});