From 65bfe8163c34f76f18c6ed247510d711d306ab3b Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 7 Nov 2022 20:05:33 -0600 Subject: [PATCH] fix error when navigating to huge transactions --- .../transaction-preview.component.ts | 5 +++-- .../transaction/transaction.component.html | 2 +- .../transaction/transaction.component.ts | 6 ++++-- .../transactions-list.component.html | 2 +- .../transactions-list.component.ts | 2 +- frontend/src/app/services/state.service.ts | 17 +++++++++++++++++ 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/components/transaction/transaction-preview.component.ts b/frontend/src/app/components/transaction/transaction-preview.component.ts index cc9dfac56..6c04af0ab 100644 --- a/frontend/src/app/components/transaction/transaction-preview.component.ts +++ b/frontend/src/app/components/transaction/transaction-preview.component.ts @@ -117,8 +117,9 @@ export class TransactionPreviewComponent implements OnInit, OnDestroy { }), switchMap(() => { let transactionObservable$: Observable; - if (history.state.data && history.state.data.fee !== -1) { - transactionObservable$ = of(history.state.data); + const cached = this.stateService.getTxFromCache(this.txId); + if (cached && cached.fee !== -1) { + transactionObservable$ = of(cached); } else { transactionObservable$ = this.electrsApiService .getTransaction$(this.txId) diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index ec0e824c8..1822f5d35 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -3,7 +3,7 @@