From 8e2838264f5fd0e8ba41a667c6da446de69bad97 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Mon, 15 Aug 2022 15:00:31 +0530 Subject: [PATCH] Run binding when isLoading changes --- src/domain/session/room/timeline/tiles/GapTile.js | 1 + src/platform/web/ui/session/room/timeline/GapView.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/domain/session/room/timeline/tiles/GapTile.js b/src/domain/session/room/timeline/tiles/GapTile.js index f41dd722..3a7f7533 100644 --- a/src/domain/session/room/timeline/tiles/GapTile.js +++ b/src/domain/session/room/timeline/tiles/GapTile.js @@ -38,6 +38,7 @@ export class GapTile extends SimpleTile { } catch (err) { console.error(`room.fillGap(): ${err.message}:\n${err.stack}`); this._error = err; + this._loading = false; this.emitChange("error"); if (err instanceof ConnectionError) { /* diff --git a/src/platform/web/ui/session/room/timeline/GapView.js b/src/platform/web/ui/session/room/timeline/GapView.js index 03f87fcf..87afe503 100644 --- a/src/platform/web/ui/session/room/timeline/GapView.js +++ b/src/platform/web/ui/session/room/timeline/GapView.js @@ -30,16 +30,17 @@ export class GapView extends TemplateView { isAtTop: vm => vm.isAtTop, }; return t.li({ className }, [ - t.map(vm => vm.error, - (error, t, vm) => { + t.map(vm => vm.isLoading, + (isLoading, t, vm) => { let elements; + const error = vm.error; if (error) { elements = [t.strong(() => error.message)]; if (error.showSpinner) { elements.unshift(spinner(t)); } } - else if (vm.isLoading) { + else if (isLoading) { elements = [spinner(t), t.span(vm.i18n`Loading more messages …`)]; } else {