diff --git a/src/domain/session/room/timeline/TimelineViewModel.js b/src/domain/session/room/timeline/TimelineViewModel.js index 31be88ac..32a92cee 100644 --- a/src/domain/session/room/timeline/TimelineViewModel.js +++ b/src/domain/session/room/timeline/TimelineViewModel.js @@ -70,8 +70,13 @@ export class TimelineViewModel extends ViewModel { onReset: (idx, tile) => checkForUpdate(idx, tile) }; this.tiles.subscribe(subscription); - const gapResult = await gapPromise; - this.tiles.unsubscribe(subscription); + let gapResult; + try { + gapResult = await gapPromise; + } + finally { + this.tiles.unsubscribe(subscription); + } if (!gapResult) { return; }