From 3572ba837ddd8f9744a9f9414df6fe039beef66c Mon Sep 17 00:00:00 2001 From: softsimon Date: Thu, 1 Dec 2022 23:12:02 +0900 Subject: [PATCH] Fix for javascript errors when navigating blocks --- .../block-overview-graph/block-overview-graph.component.ts | 2 ++ .../transactions-list/transactions-list.component.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/frontend/src/app/components/block-overview-graph/block-overview-graph.component.ts b/frontend/src/app/components/block-overview-graph/block-overview-graph.component.ts index 6da576e99..37225ea1d 100644 --- a/frontend/src/app/components/block-overview-graph/block-overview-graph.component.ts +++ b/frontend/src/app/components/block-overview-graph/block-overview-graph.component.ts @@ -77,6 +77,8 @@ export class BlockOverviewGraphComponent implements AfterViewInit, OnDestroy, On cancelAnimationFrame(this.animationFrameRequest); clearTimeout(this.animationHeartBeat); } + this.canvas.nativeElement.removeEventListener('webglcontextlost', this.handleContextLost); + this.canvas.nativeElement.removeEventListener('webglcontextrestored', this.handleContextRestored); } clear(direction): void { diff --git a/frontend/src/app/components/transactions-list/transactions-list.component.ts b/frontend/src/app/components/transactions-list/transactions-list.component.ts index 072d71311..8b4fabf6e 100644 --- a/frontend/src/app/components/transactions-list/transactions-list.component.ts +++ b/frontend/src/app/components/transactions-list/transactions-list.component.ts @@ -91,6 +91,9 @@ export class TransactionsListComponent implements OnInit, OnChanges { filter(() => this.stateService.env.LIGHTNING), switchMap((txIds) => this.apiService.getChannelByTxIds$(txIds)), tap((channels) => { + if (!this.transactions) { + return; + } const transactions = this.transactions.filter((tx) => !tx._channels); channels.forEach((channel, i) => { transactions[i]._channels = channel;