From 54d98c22ba5019072f23b4938d9501b37fee5603 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 15 Sep 2019 21:25:36 +0100 Subject: [PATCH 1/2] Reuse showRoom for onJoinClick so we join using alias if its available Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/RoomDirectory.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index f81c0c94c0..3c30e1d11e 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -390,12 +390,7 @@ module.exports = createReactClass({ onJoinClick: function(ev, room) { this.props.onFinished(); - MatrixClientPeg.get().joinRoom(room.room_id); - dis.dispatch({ - action: 'view_room', - room_id: room.room_id, - joining: true, - }); + this.showRoom(room, null, true); ev.stopPropagation(); }, From 7f5d38772d249d31e4ef0b3235ec9ab45cf90579 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 15 Sep 2019 21:30:01 +0100 Subject: [PATCH 2/2] don't fire onFinished twice Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/RoomDirectory.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 3c30e1d11e..84f402e484 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -389,7 +389,6 @@ module.exports = createReactClass({ }, onJoinClick: function(ev, room) { - this.props.onFinished(); this.showRoom(room, null, true); ev.stopPropagation(); },