From 98312a464762aa3e984c76e5ef611f1e307c0d9d Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 3 Nov 2017 17:37:13 +0000 Subject: [PATCH 1/2] Use, if possible, a room's canonical or first alias when viewing the room (Only affects rooms the user has never joined) --- src/components/views/rooms/RoomDetailList.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/views/rooms/RoomDetailList.js b/src/components/views/rooms/RoomDetailList.js index 5374094f1f..69f3faa325 100644 --- a/src/components/views/rooms/RoomDetailList.js +++ b/src/components/views/rooms/RoomDetailList.js @@ -49,6 +49,7 @@ const RoomDetailRow = React.createClass({ dis.dispatch({ action: 'view_room', room_id: this.props.room.roomId, + room_alias: this.props.room.canonicalAlias || this.props.room.aliases[0], }); }, From 58f1757f0cd350d213f6bc3e68a8900810f052b2 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 3 Nov 2017 17:52:36 +0000 Subject: [PATCH 2/2] Handle rooms with no aliases or canonical alias --- src/components/views/rooms/RoomDetailList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomDetailList.js b/src/components/views/rooms/RoomDetailList.js index 69f3faa325..c44b662fa7 100644 --- a/src/components/views/rooms/RoomDetailList.js +++ b/src/components/views/rooms/RoomDetailList.js @@ -49,7 +49,7 @@ const RoomDetailRow = React.createClass({ dis.dispatch({ action: 'view_room', room_id: this.props.room.roomId, - room_alias: this.props.room.canonicalAlias || this.props.room.aliases[0], + room_alias: this.props.room.canonicalAlias || (this.props.room.aliases || [])[0], }); },