From 341175ea5847c2b15f2515ed7848f85637a170e0 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 18 Nov 2016 11:15:14 +0000 Subject: [PATCH] Fix pagination issue where recent events are lost (#563) Fix pagination issue where recent events are lost Scrolling up a few pages followed by scrolling down to the most recent events previously caused some events to go missing. A test has been modified in conjunction with this fix to make sure that this failure mode is tested for in future. This commit should fix the issue, and the most recent events should be paginated back in. --- src/components/structures/TimelinePanel.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index 3d204be510..4311f683df 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -265,7 +265,11 @@ var TimelinePanel = React.createClass({ if (count > 0) { debuglog("TimelinePanel: Unpaginating", count, "in direction", dir); this._timelineWindow.unpaginate(count, backwards); + + // We can now paginate in the unpaginated direction + const canPaginateKey = (backwards) ? 'canBackPaginate' : 'canForwardPaginate'; this.setState({ + [canPaginateKey]: true, events: this._getEvents(), }); }