From e6f43d6f4f32717153eda313a77a04ff970d2bbd Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Fri, 19 Aug 2022 11:55:23 +0530 Subject: [PATCH] Put logic into VM --- src/domain/session/room/timeline/tiles/GapTile.js | 12 ++++++++++++ src/platform/web/ui/session/room/timeline/GapView.js | 12 +----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/domain/session/room/timeline/tiles/GapTile.js b/src/domain/session/room/timeline/tiles/GapTile.js index 7aae124d..56d05edd 100644 --- a/src/domain/session/room/timeline/tiles/GapTile.js +++ b/src/domain/session/room/timeline/tiles/GapTile.js @@ -143,6 +143,18 @@ export class GapTile extends SimpleTile { } return null; } + + get currentAction() { + if (this.error) { + return this.error; + } + else if (this.isLoading) { + return "Loading"; + } + else { + return "Not Loading"; + } + } } import {FragmentBoundaryEntry} from "../../../../../matrix/room/timeline/entries/FragmentBoundaryEntry.js"; diff --git a/src/platform/web/ui/session/room/timeline/GapView.js b/src/platform/web/ui/session/room/timeline/GapView.js index e80321be..4fc0e3d6 100644 --- a/src/platform/web/ui/session/room/timeline/GapView.js +++ b/src/platform/web/ui/session/room/timeline/GapView.js @@ -31,17 +31,7 @@ export class GapView extends TemplateView { }; return t.li({ className }, [ t.if(vm => vm.showSpinner, (t) => spinner(t)), - t.span(vm => { - if (vm.error) { - return vm.error; - } - else if (vm.isLoading) { - return "Loading"; - } - else { - return "Not Loading"; - } - }) + t.span(vm => vm.currentAction) ]); }