Skip to content

Commit

Permalink
Refuse to set forwards pagination token on live timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live authored and bwindels committed Apr 8, 2019
1 parent 963e271 commit 828c514
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/models/event-timeline-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,14 @@ EventTimelineSet.prototype.addEventsToTimeline = function(events, toStartOfTimel
// new information, we update the pagination token for whatever
// timeline we ended up on.
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);
}
};
Expand Down

0 comments on commit 828c514

Please sign in to comment.