fix error when navigating to huge transactions

This commit is contained in:
Mononaut
2022-11-07 20:05:33 -06:00
parent 02820b0e68
commit 65bfe8163c
6 changed files with 27 additions and 7 deletions

View File

@@ -117,8 +117,9 @@ export class TransactionPreviewComponent implements OnInit, OnDestroy {
}),
switchMap(() => {
let transactionObservable$: Observable<Transaction>;
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)