Removes cards. Fix history. New method getInvoiceHistory
This commit is contained in:
parent
c14a3b0658
commit
63916402a3
7 changed files with 89 additions and 54 deletions
|
|
@ -1,17 +1,17 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesBitpayCardController',
|
||||
function($scope, $state, $timeout, $ionicHistory, bitpayCardService, popupService) {
|
||||
function($scope, $state, $timeout, $ionicHistory, bitpayCardService, popupService, gettextCatalog) {
|
||||
|
||||
$scope.logout = function() {
|
||||
var msg = 'Are you sure you would like to log out of your BitPay Card account?';
|
||||
$scope.remove = function() {
|
||||
var msg = gettextCatalog.getString('Are you sure you would like to remove your BitPay Card account from this device?');
|
||||
popupService.showConfirm(null, msg, null, null, function(res) {
|
||||
if (res) logout();
|
||||
if (res) remove();
|
||||
});
|
||||
};
|
||||
|
||||
var logout = function() {
|
||||
bitpayCardService.logout(function() {
|
||||
var remove = function() {
|
||||
bitpayCardService.remove(function() {
|
||||
$ionicHistory.removeBackView();
|
||||
$timeout(function() {
|
||||
$state.go('tabs.home');
|
||||
|
|
@ -19,4 +19,11 @@ angular.module('copayApp.controllers').controller('preferencesBitpayCardControll
|
|||
});
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
bitpayCardService.getBitpayDebitCards(function(err, data) {
|
||||
if (err) return;
|
||||
$scope.bitpayCards = data.cards;
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue