You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2026-01-03 23:22:30 +03:00
Flag the top of the timeline when we hit it
This commit is contained in:
@@ -2196,6 +2196,13 @@ MatrixClient.prototype.paginateEventTimeline = function(eventTimeline, opts) {
|
||||
var room = self.getRoom(eventTimeline.getRoomId());
|
||||
var matrixEvents = utils.map(res.chunk, self.getEventMapper());
|
||||
room.addEventsToTimeline(matrixEvents, backwards, eventTimeline, token);
|
||||
|
||||
// if we've hit the end of the timeline, we need to stop trying to
|
||||
// paginate. We need to keep the 'forwards' token though, to make sure
|
||||
// we can recover from gappy syncs.
|
||||
if (backwards && res.end == res.start) {
|
||||
eventTimeline.setPaginationToken(null, true);
|
||||
}
|
||||
return res.end != res.start;
|
||||
}).finally(function() {
|
||||
eventTimeline._paginationRequests[dir] = null;
|
||||
|
||||
Reference in New Issue
Block a user