From 3144b9f1a2eccd1ce6091b78a4f0fadc905a982c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 7 Aug 2019 12:06:27 -0600 Subject: [PATCH] Disable 'Start New Chat' button in MemberInfo if we already have chats Part of https://github.com/vector-im/riot-web/issues/10416 --- src/components/views/rooms/MemberInfo.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index 8cabb5af48..629790a743 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -789,6 +789,7 @@ module.exports = React.createClass({ let spinner; if (this.props.member.userId !== this.context.matrixClient.credentials.userId) { + // TODO: Immutable DMs replaces a lot of this const dmRoomMap = new DMRoomMap(this.context.matrixClient); // dmRooms will not include dmRooms that we have been invited into but did not join. // Because DMRoomMap runs off account_data[m.direct] which is only set on join of dm room. @@ -830,7 +831,7 @@ module.exports = React.createClass({ mx_MemberInfo_createRoom_label: true, mx_RoomTile_name: true, }); - const startNewChat = @@ -840,6 +841,8 @@ module.exports = React.createClass({
{ _t("Start a chat") }
; + if (tiles.length > 0) startNewChat = null; // Don't offer a button for a new chat if we have one. + startChat =

{ _t("Direct chats") }

{ tiles }