From 7e8c0109aee1efa8c5b4baae778c96b53cdb5b25 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Thu, 28 Oct 2021 11:57:18 +0530 Subject: [PATCH] Add explaining comment Signed-off-by: RMidhunSuresh --- src/domain/session/room/timeline/TimelineViewModel.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/domain/session/room/timeline/TimelineViewModel.js b/src/domain/session/room/timeline/TimelineViewModel.js index 8ff6b09e..31be88ac 100644 --- a/src/domain/session/room/timeline/TimelineViewModel.js +++ b/src/domain/session/room/timeline/TimelineViewModel.js @@ -53,6 +53,12 @@ export class TimelineViewModel extends ViewModel { let hasSeenUpdate = false; const checkForUpdate = (idx, tile) => { if (tile.shape !== "gap") { + /* + It's possible that this method executes before the GapTile has been rendered, + so don't count the GapTile as an update. + Usually happens when onScroll() is triggered by a non-timeline UI change, + eg: SessionStatusView being rendered + */ hasSeenUpdate = true; } }