Removes cards. Fix history. New method getInvoiceHistory

This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-07 15:51:15 -03:00
commit 63916402a3
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
7 changed files with 89 additions and 54 deletions

View file

@ -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;
});
});
});