Merge branch 'master' into feat/bitpay-accounts
This commit is contained in:
commit
7a2d386f34
6 changed files with 19 additions and 36 deletions
|
|
@ -425,9 +425,9 @@ angular.module('copayApp.services')
|
|||
// }
|
||||
root.removeBitpayDebitCard = function(network, cardEid, cb) {
|
||||
|
||||
root.getBitpayAccounts(network, function(err, allAccounts){
|
||||
root.getBitpayAccounts(network, function(err, allAccounts) {
|
||||
|
||||
lodash.each(allAccounts, function(account){
|
||||
lodash.each(allAccounts, function(account) {
|
||||
account.cards = lodash.reject(account.cards, {
|
||||
'eid': cardEid
|
||||
});
|
||||
|
|
@ -458,10 +458,16 @@ angular.module('copayApp.services')
|
|||
storage.get('bitpayAccounts-v2-' + network, function(err, allAccountsStr) {
|
||||
if (err) return cb(err);
|
||||
|
||||
if (!allAccountsStr)
|
||||
return cb(null, {});
|
||||
|
||||
var allAccounts = {};
|
||||
try {
|
||||
allAccounts = JSON.parse(allAccountsStr);
|
||||
} catch (e) {};
|
||||
} catch (e) {
|
||||
$log.error('Bad storage value for bitpayAccount-v2' + allAccountsStr)
|
||||
return cb(null, {});
|
||||
};
|
||||
|
||||
var anyMigration;
|
||||
|
||||
|
|
@ -485,10 +491,10 @@ angular.module('copayApp.services')
|
|||
});
|
||||
|
||||
if (anyMigration) {
|
||||
storage.set('bitpayAccounts-v2-' + network, allAccounts, function(){
|
||||
storage.set('bitpayAccounts-v2-' + network, allAccounts, function() {
|
||||
return cb(err, allAccounts);
|
||||
});
|
||||
} else
|
||||
} else
|
||||
return cb(err, allAccounts);
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue