fix storage pull
This commit is contained in:
parent
2d05e05e31
commit
2d3da332c4
1 changed files with 8 additions and 5 deletions
|
|
@ -414,9 +414,9 @@ angular.module('copayApp.services')
|
||||||
// }
|
// }
|
||||||
root.removeBitpayDebitCard = function(network, cardEid, cb) {
|
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, {
|
account.cards = lodash.reject(account.cards, {
|
||||||
'eid': cardEid
|
'eid': cardEid
|
||||||
});
|
});
|
||||||
|
|
@ -450,7 +450,10 @@ angular.module('copayApp.services')
|
||||||
var allAccounts = {};
|
var allAccounts = {};
|
||||||
try {
|
try {
|
||||||
allAccounts = JSON.parse(allAccountsStr);
|
allAccounts = JSON.parse(allAccountsStr);
|
||||||
} catch (e) {};
|
} catch (e) {
|
||||||
|
$log.error('Bad storage value for bitpayAccount-v2' + allAccountsStr)
|
||||||
|
return cb(null, {});
|
||||||
|
};
|
||||||
|
|
||||||
var anyMigration;
|
var anyMigration;
|
||||||
|
|
||||||
|
|
@ -474,7 +477,7 @@ angular.module('copayApp.services')
|
||||||
});
|
});
|
||||||
|
|
||||||
if (anyMigration) {
|
if (anyMigration) {
|
||||||
storage.set('bitpayAccounts-v2-' + network, allAccounts, function(){
|
storage.set('bitpayAccounts-v2-' + network, allAccounts, function() {
|
||||||
return cb(err, allAccounts);
|
return cb(err, allAccounts);
|
||||||
});
|
});
|
||||||
} else
|
} else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue