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.
This commit is contained in:
Luke Barnard 2016-11-18 11:15:14 +00:00 committed by GitHub
parent d3c9792126
commit 341175ea58

View file

@ -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(),
});
}