FIX: better handling of errors from HodlHodl

This commit is contained in:
Overtorment 2020-09-07 12:21:14 +01:00
parent 34f98044cc
commit f64238931c
2 changed files with 5 additions and 3 deletions

View file

@ -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',
{

View file

@ -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');