From 3c2c2b051b062ad027a0bb8446e18b90bbc7f188 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 4 Feb 2016 11:29:00 +0000 Subject: [PATCH] Listen for Room and use this to init the timeline, not Room.name --- src/components/structures/RoomView.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 9df007e490..f77e2e226d 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -122,6 +122,7 @@ module.exports = React.createClass({ componentWillMount: function() { this.last_rr_sent_event_id = undefined; this.dispatcherRef = dis.register(this.onAction); + MatrixClientPeg.get().on("Room", this.onRoom); MatrixClientPeg.get().on("Room.timeline", this.onRoomTimeline); MatrixClientPeg.get().on("Room.name", this.onRoomName); MatrixClientPeg.get().on("Room.accountData", this.onRoomAccountData); @@ -418,12 +419,20 @@ module.exports = React.createClass({ } }, + onRoom: function(room) { + if (room.roomId == this.props.roomId) { + this.setState({ + room: room + }); + this._initTimeline(this.props).done(); + } + }, + onRoomName: function(room) { if (room.roomId == this.props.roomId) { this.setState({ room: room }); - this._initTimeline(this.props); } },