`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.
pull/3376/head
Luke Barnard 2017-03-06 17:55:12 +00:00
parent c6da4d93f1
commit 3d67234372
1 changed files with 10 additions and 1 deletions

View File

@ -146,6 +146,13 @@ var RoomSubList = React.createClass({
} }
}, },
onRoomTileClick(roomId) {
dis.dispatch({
action: 'view_room',
room_id: roomId,
});
},
tsOfNewestEvent: function(room) { tsOfNewestEvent: function(room) {
for (var i = room.timeline.length - 1; i >= 0; --i) { for (var i = room.timeline.length - 1; i >= 0; --i) {
var ev = room.timeline[i]; var ev = room.timeline[i];
@ -364,7 +371,9 @@ var RoomSubList = React.createClass({
highlight={ room.getUnreadNotificationCount('highlight') > 0 || self.props.label === 'Invites' } highlight={ room.getUnreadNotificationCount('highlight') > 0 || self.props.label === 'Invites' }
isInvite={ self.props.label === 'Invites' } isInvite={ self.props.label === 'Invites' }
refreshSubList={ self._updateSubListCount } refreshSubList={ self._updateSubListCount }
incomingCall={ null } /> incomingCall={ null }
onClick={ self.onRoomTileClick }
/>
); );
}); });
}, },