diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 1c0ed15afc..8b0419981a 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -84,7 +84,8 @@ module.exports = React.createClass({ guestsCanJoin: false, canPeek: false, readMarkerEventId: room ? room.getEventReadUpTo(MatrixClientPeg.get().credentials.userId) : null, - readMarkerGhostEventId: undefined + readMarkerGhostEventId: undefined, + atBottom: true, } }, @@ -596,9 +597,18 @@ module.exports = React.createClass({ }, onMessageListScroll: function(ev) { - if (this.state.numUnreadMessages != 0 && - this.refs.messagePanel.isAtBottom()) { - this.setState({numUnreadMessages: 0}); + if (this.refs.messagePanel.isAtBottom()) { + if (this.state.numUnreadMessages != 0) { + this.setState({ numUnreadMessages: 0 }); + } + if (!this.state.atBottom) { + this.setState({ atBottom: true }); + } + } + else { + if (this.state.atBottom) { + this.setState({ atBottom: false }); + } } }, @@ -1622,7 +1632,7 @@ module.exports = React.createClass({ else if (unreadMsgs) { statusBar = (