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 // events when viewing historical messages, we get stuck in a loop
// of paginating our way through the entire history of the room. // of paginating our way through the entire history of the room.
var stickyBottom = !this._timelineWindow.canPaginate(EventTimeline.FORWARDS); 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 ( return (
<MessagePanel ref="messagePanel" <MessagePanel ref="messagePanel"
hidden={ this.props.hidden } hidden={ this.props.hidden }
backPaginating={ this.state.backPaginating } backPaginating={ this.state.backPaginating }
forwardPaginating={ this.state.forwardPaginating } forwardPaginating={ forwardPaginating }
events={ this.state.events } events={ this.state.events }
highlightedEventId={ this.props.highlightedEventId } highlightedEventId={ this.props.highlightedEventId }
readMarkerEventId={ this.state.readMarkerEventId } readMarkerEventId={ this.state.readMarkerEventId }