From 0b52ad48bb26f1875943fba5ac2ceae3a0f61a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Tue, 6 Jul 2021 21:56:53 +0200 Subject: [PATCH] Show "Open chat" if DM already exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/right_panel/UserInfo.tsx | 2 +- src/i18n/strings/en_EN.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index e9d80d49c5..5815818096 100644 --- a/src/components/views/right_panel/UserInfo.tsx +++ b/src/components/views/right_panel/UserInfo.tsx @@ -428,7 +428,7 @@ const UserOptionsSection: React.FC<{ if (!isMe) { directMessageButton = ( openDMForUser(cli, member.userId)} className="mx_UserInfo_field"> - { _t('Direct message') } + { findDMForUser(cli, member.userId) ? _t("Open chat") : _t('Direct message') } ); } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index bbf6954435..2e2d5fa1ef 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1784,6 +1784,7 @@ "Mention": "Mention", "Invite": "Invite", "Share Link to User": "Share Link to User", + "Open chat": "Open chat", "Direct message": "Direct message", "Demote yourself?": "Demote yourself?", "You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the space it will be impossible to regain privileges.": "You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the space it will be impossible to regain privileges.",