diff --git a/src/pages/wallet-details/wallet-details.ts b/src/pages/wallet-details/wallet-details.ts index d23fc5b29..41dc591fd 100644 --- a/src/pages/wallet-details/wallet-details.ts +++ b/src/pages/wallet-details/wallet-details.ts @@ -32,7 +32,7 @@ export class WalletDetailsPage { if (force) this.wallet.completeHistory = []; this.walletProvider.getTxHistory_(this.wallet, {force: force}).then((txh) => { - this.wallet.completeHistory = this.wallet.completeHistory = txh; + this.wallet.completeHistory = txh; }).catch((err) => { console.log(err); }); diff --git a/src/providers/wallet/wallet.ts b/src/providers/wallet/wallet.ts index 09f270d4c..ac5643675 100644 --- a/src/providers/wallet/wallet.ts +++ b/src/providers/wallet/wallet.ts @@ -392,14 +392,13 @@ export class WalletProvider { } private updateTxHistory_(wallet: any, txsFromLocal: any, txsFromServer?: any) { - let array = lodash.compact(txsFromLocal.concat(txsFromServer)); + let array = lodash.compact(txsFromLocal.concat(lodash.map(txsFromServer, 'res'))); let newHistory = lodash.uniqBy(array, (x: any) => { return x.txid; }); wallet.completeHistory = newHistory; wallet.completeHistory.isValid = true; - - let historyToSave = lodash.compact(lodash.flatten(lodash.map(newHistory, 'res'))); + let historyToSave = lodash.compact(lodash.flatten(newHistory)); this.persistenceProvider.setTxHistory(wallet.credentials.walletId, JSON.stringify(historyToSave)).then(() => { this.logger.debug('Tx History saved for: ' + wallet.credentials.walletId);