mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 06:52:41 +01:00
FIX: better handling of errors from HodlHodl
This commit is contained in:
parent
34f98044cc
commit
f64238931c
2 changed files with 5 additions and 3 deletions
|
@ -408,14 +408,12 @@ export class AppStorage {
|
|||
|
||||
offloadWalletToRealm(realm, wallet) {
|
||||
const id = wallet.getID();
|
||||
console.log('offloading wallet id', id);
|
||||
const walletToSave = wallet._hdWalletInstance ?? wallet;
|
||||
|
||||
if (walletToSave instanceof AbstractHDElectrumWallet) {
|
||||
realm.write(() => {
|
||||
const j1 = JSON.stringify(walletToSave._txs_by_external_index);
|
||||
const j2 = JSON.stringify(walletToSave._txs_by_internal_index);
|
||||
console.log('j1 = ', j1.length / 1024, 'kb; j2 = ', j2.length / 1024, 'kb');
|
||||
realm.create(
|
||||
'Wallet',
|
||||
{
|
||||
|
|
|
@ -226,7 +226,11 @@ export class HodlHodlApi {
|
|||
validationErrorsToReadable(errorz) {
|
||||
const ret = [];
|
||||
for (const er of Object.keys(errorz)) {
|
||||
ret.push(errorz[er].join('; '));
|
||||
if (Array.isArray(errorz[er])) {
|
||||
ret.push(errorz[er].join('; '));
|
||||
} else {
|
||||
ret.push(errorz[er]);
|
||||
}
|
||||
}
|
||||
|
||||
return ret.join('\n');
|
||||
|
|
Loading…
Add table
Reference in a new issue