Show spinner until first sync has completed

Shows the 'forward paginating' spinner until the first sync has
completed.

Fixes https://github.com/vector-im/riot-web/issues/3318
This commit is contained in:
David Baker 2017-04-26 14:05:09 +01:00
parent 5cbf77b53e
commit df283dae47

View File

@ -1058,11 +1058,18 @@ var TimelinePanel = React.createClass({
// events when viewing historical messages, we get stuck in a loop
// of paginating our way through the entire history of the room.
var stickyBottom = !this._timelineWindow.canPaginate(EventTimeline.FORWARDS);
// If the state is PREPARED, we're still waiting for the js-sdk to sync with
// the HS and fetch the latest events, so we are effectively forward paginating.
const forwardPaginating = (
this.state.forwardPaginating || MatrixClientPeg.get().getSyncState() == 'PREPARED'
);
return (
<MessagePanel ref="messagePanel"
hidden={ this.props.hidden }
backPaginating={ this.state.backPaginating }
forwardPaginating={ this.state.forwardPaginating }
forwardPaginating={ forwardPaginating }
events={ this.state.events }
highlightedEventId={ this.props.highlightedEventId }
readMarkerEventId={ this.state.readMarkerEventId }