You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-29 16:43:09 +03:00
Refuse to set forwards pagination token on live timeline
Should fix the error seen in https://github.com/matrix-org/riot-web-rageshakes/issues/1389 (https://github.com/vector-im/riot-web/issues/8593)
This commit is contained in:
@@ -446,6 +446,14 @@ EventTimelineSet.prototype.addEventsToTimeline = function(events, toStartOfTimel
|
|||||||
// new information, we update the pagination token for whatever
|
// new information, we update the pagination token for whatever
|
||||||
// timeline we ended up on.
|
// timeline we ended up on.
|
||||||
if (lastEventWasNew || !didUpdate) {
|
if (lastEventWasNew || !didUpdate) {
|
||||||
|
if (direction === EventTimeline.FORWARDS && timeline === this._liveTimeline) {
|
||||||
|
console.warn({lastEventWasNew, didUpdate}); // for debugging
|
||||||
|
console.warn(
|
||||||
|
`Refusing to set forwards pagination token of live timeline ` +
|
||||||
|
`${timeline} to ${paginationToken}`,
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
timeline.setPaginationToken(paginationToken, direction);
|
timeline.setPaginationToken(paginationToken, direction);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user