From 98678b991b087a0c66531e74f6ec999b909529af Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 8 Sep 2021 16:39:46 +0200 Subject: [PATCH] no need to store visible state on gap tile & don't fill if edge reached --- src/domain/session/room/timeline/tiles/GapTile.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/domain/session/room/timeline/tiles/GapTile.js b/src/domain/session/room/timeline/tiles/GapTile.js index eee77ef8..c85b6a09 100644 --- a/src/domain/session/room/timeline/tiles/GapTile.js +++ b/src/domain/session/room/timeline/tiles/GapTile.js @@ -22,12 +22,10 @@ export class GapTile extends SimpleTile { super(options); this._loading = false; this._error = null; - this._visible = false; } async fill() { - // prevent doing this twice - if (!this._loading) { + if (!this._loading && !this._entry.edgeReached) { this._loading = true; this.emitChange("isLoading"); try { @@ -44,13 +42,10 @@ export class GapTile extends SimpleTile { this.emitChange("isLoading"); } } - // edgeReached will have been updated by fillGap - return this._entry.edgeReached; } setVisible(isVisible) { - this._visible = isVisible; - if (this._visible && !this.isLoading) { + if (isVisible) { this.fill(); } }