diff --git a/src/domain/session/room/timeline/TimelineViewModel.js b/src/domain/session/room/timeline/TimelineViewModel.js index 5db80976..222a05b7 100644 --- a/src/domain/session/room/timeline/TimelineViewModel.js +++ b/src/domain/session/room/timeline/TimelineViewModel.js @@ -83,10 +83,12 @@ export class TimelineViewModel extends ViewModel { } if (loadTop && !this._topLoadingPromise) { - this._topLoadingPromise = this._timeline.loadAtTop(10).then(() => { + this._topLoadingPromise = this._timeline.loadAtTop(10).then(hasReachedEnd => { this._topLoadingPromise = null; - // check if more items need to be loaded by recursing - this.setVisibleTileRange(this._startTile, this._endTile); + if (!hasReachedEnd) { + // check if more items need to be loaded by recursing + this.setVisibleTileRange(this._startTile, this._endTile); + } }); } else if (loadTop) { console.log("loadTop is true but already loading");