From 0b0e6adce3b05b1fc42a97f7372d23fd71c9f29d Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 12 Jun 2015 18:01:38 +0100 Subject: [PATCH] Make room changing work --- src/organisms/RoomView.js | 6 ++++++ src/pages/MatrixChat.js | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/organisms/RoomView.js b/src/organisms/RoomView.js index 5f35ccfb33..bf921b063f 100644 --- a/src/organisms/RoomView.js +++ b/src/organisms/RoomView.js @@ -11,6 +11,12 @@ module.exports = React.createClass({ } }, + componentWillReceiveProps: function(props) { + this.setState({ + room: MatrixClientPeg.get().getRoom(props.room_id) + }); + }, + getMessageTiles: function() { return this.state.room.timeline.map(function(mxEv) { return ( diff --git a/src/pages/MatrixChat.js b/src/pages/MatrixChat.js index 9eb8f14ff9..ca9cab78dd 100644 --- a/src/pages/MatrixChat.js +++ b/src/pages/MatrixChat.js @@ -39,6 +39,11 @@ module.exports = React.createClass({ ready: false }); break; + case 'view_room': + this.setState({ + currentRoom: payload.room_id + }); + break; } },