Upgrade only one account at a time.
This commit is contained in:
parent
e9f30fa053
commit
56bff1db41
1 changed files with 6 additions and 5 deletions
|
|
@ -280,11 +280,12 @@ angular.module('copayApp.services')
|
||||||
if (lodash.isString(bitpayAccounts)) {
|
if (lodash.isString(bitpayAccounts)) {
|
||||||
bitpayAccounts = JSON.parse(bitpayAccounts);
|
bitpayAccounts = JSON.parse(bitpayAccounts);
|
||||||
}
|
}
|
||||||
bitpayAccounts = bitpayAccounts || {};
|
// Ensure only the specified account is set (data.email)
|
||||||
bitpayAccounts[data.email] = bitpayAccounts[data.email] || {};
|
var upgradedBitpayAccount = {};
|
||||||
bitpayAccounts[data.email]['bitpayApi-' + network] = bitpayAccounts[data.email]['bitpayApi-' + network] || {};
|
upgradedBitpayAccount[data.email] = bitpayAccounts[data.email] || {};
|
||||||
bitpayAccounts[data.email]['bitpayApi-' + network].token = data.token;
|
upgradedBitpayAccount[data.email]['bitpayApi-' + network] = {};
|
||||||
storage.set('bitpayAccounts-v2-' + network, JSON.stringify(bitpayAccounts), cb);
|
upgradedBitpayAccount[data.email]['bitpayApi-' + network].token = data.token;
|
||||||
|
storage.set('bitpayAccounts-v2-' + network, JSON.stringify(upgradedBitpayAccount), cb);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue