From 35a92bf85fcb8fc29ed2a5f70b16891d9463f2ad Mon Sep 17 00:00:00 2001 From: Bernd Hufmann Date: Fri, 23 Oct 2020 14:47:07 -0400 Subject: [PATCH] Reset fetching flag in a try-finally statement Fixes #66 Signed-off-by: Bernd Hufmann --- timeline-chart/src/layer/time-graph-chart.ts | 24 ++++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/timeline-chart/src/layer/time-graph-chart.ts b/timeline-chart/src/layer/time-graph-chart.ts index cd3faea..abeb910 100644 --- a/timeline-chart/src/layer/time-graph-chart.ts +++ b/timeline-chart/src/layer/time-graph-chart.ts @@ -188,18 +188,22 @@ export class TimeGraphChart extends TimeGraphChartLayer { update )) { this.fetching = true; - const rowData = await this.providers.dataProvider(viewRange, resolution); - if (rowData) { - this.providedResolution = rowData.resolution; - this.providedRange = rowData.range; - this.setRowModel(rowData.rows); - this.removeChildren(); - this.addRows(this.rows, this.rowController.rowHeight); - if (this.isNavigating) { - this.selectStateInNavigation(); + try { + const rowData = await this.providers.dataProvider(viewRange, resolution); + if (rowData) { + this.providedResolution = rowData.resolution; + this.providedRange = rowData.range; + this.setRowModel(rowData.rows); + this.removeChildren(); + this.addRows(this.rows, this.rowController.rowHeight); + if (this.isNavigating) { + this.selectStateInNavigation(); + } } + } finally { + this.fetching = false; + this.isNavigating = false; } - this.fetching = false; } }