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.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
|
||||
});
|
||||
|
|
@ -450,7 +450,10 @@ angular.module('copayApp.services')
|
|||
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;
|
||||
|
||||
|
|
@ -474,10 +477,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