bitpay card integration in home. Cache TODO

This commit is contained in:
Matias Alejo Garcia 2017-01-31 09:30:27 -03:00
commit 24c2d735cc
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
4 changed files with 52 additions and 48 deletions

View file

@ -60,8 +60,8 @@ angular.module('copayApp.services').factory('bitpayCardService', function($log,
n.eid = x.eid;
n.id = x.id;
n.lastFourDigits = x.lastFourDigits;
n.token = x.token;
n.lastFourDigits = x.lastFourDigits;
n.token = x.token;
cards.push(n);
});
@ -188,7 +188,7 @@ angular.module('copayApp.services').factory('bitpayCardService', function($log,
// storageService.setBitpayDebitCardHistory(cardId, data, cb);
// };
//
root.remove = function(cardId, cb) {
storageService.removeBitpayDebitCard(bitpayService.getEnvironment().network, cardId, function(err) {
if (err) {
@ -210,6 +210,28 @@ angular.module('copayApp.services').factory('bitpayCardService', function($log,
});
};
root.get = function(cb) {
root.getCards(function(err, cards) {
if (err) return;
if (lodash.isEmpty(cards)) {
return cb();
}
// TODO
// bitpayCardService.getCardsHistoryCache(function(err, data) {
// if (err) return;
// if (lodash.isEmpty(data)) {
// $scope.cardsHistory = null;
// return;
// }
// $scope.cardsHistory = data;
// });
return cb(null, cards);
});
};
/*
* CONSTANTS
*/