You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-18 05:42:00 +03:00
Modify how detection of the end of pagination is done
Synapse may filter down the events resulting in < 'limit' events being returned *but it still has more events*. Change the check to see if the request returned an empty array instead. This may add an extra HTTP hit.
This commit is contained in:
@@ -1638,7 +1638,7 @@ MatrixClient.prototype.scrollback = function(room, limit, callback) {
|
||||
var matrixEvents = utils.map(res.chunk, _PojoToMatrixEventMapper(self));
|
||||
room.addEventsToTimeline(matrixEvents, true);
|
||||
room.oldState.paginationToken = res.end;
|
||||
if (res.chunk.length < limit) {
|
||||
if (res.chunk.length === 0) {
|
||||
room.oldState.paginationToken = null;
|
||||
}
|
||||
self.store.storeEvents(room, matrixEvents, res.end, true);
|
||||
|
Reference in New Issue
Block a user