From cc4fa6140cc35d8ee22cebb44f5297d54810d275 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 23 Jun 2015 11:36:19 +0100 Subject: [PATCH] Fix joining --- src/controllers/organisms/RoomView.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/controllers/organisms/RoomView.js b/src/controllers/organisms/RoomView.js index 673ba78255..c0be340184 100644 --- a/src/controllers/organisms/RoomView.js +++ b/src/controllers/organisms/RoomView.js @@ -25,6 +25,9 @@ module.exports = { },*/ onRoomTimeline: function(ev, room, toStartOfTimeline) { + // no point handling anything while we're waiting for the join to finish: + // we'll only be showing a spinner. + if (this.state.joining) return; if (room.roomId != this.props.roomId) return; if (this.refs.messageList) { @@ -51,13 +54,15 @@ module.exports = { }, onJoinButtonClicked: function(ev) { + var that = this; MatrixClientPeg.get().joinRoom(this.props.roomId).then(function() { - this.setState({ - joining: undefined + that.setState({ + joining: false, + room: MatrixClientPeg.get().getRoom(that.props.roomId) }); }, function(error) { - this.setState({ - joining: undefined, + that.setState({ + joining: false, joinError: error }); });