From 3d67234372f3329248274881a953f2345e5dae55 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Mon, 6 Mar 2017 17:55:12 +0000 Subject: [PATCH] `view_room` dispatch from `onClick` RoomTile So that RoomTile does less, and if other things should happen onClick, they happen in the same place as the `view_room` for clarity. --- src/components/structures/RoomSubList.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index af8500df..0469f52a 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -146,6 +146,13 @@ var RoomSubList = React.createClass({ } }, + onRoomTileClick(roomId) { + dis.dispatch({ + action: 'view_room', + room_id: roomId, + }); + }, + tsOfNewestEvent: function(room) { for (var i = room.timeline.length - 1; i >= 0; --i) { var ev = room.timeline[i]; @@ -364,7 +371,9 @@ var RoomSubList = React.createClass({ highlight={ room.getUnreadNotificationCount('highlight') > 0 || self.props.label === 'Invites' } isInvite={ self.props.label === 'Invites' } refreshSubList={ self._updateSubListCount } - incomingCall={ null } /> + incomingCall={ null } + onClick={ self.onRoomTileClick } + /> ); }); },