From c4d4229340475e343d52806f3becef421b7f37c7 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 11 Oct 2021 13:50:34 +0100 Subject: [PATCH] hide leave section if you aren't in the room instead of disabling --- .../tabs/room/GeneralRoomSettingsTab.tsx | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx index 37ac358660..1cfe023ba9 100644 --- a/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx @@ -90,6 +90,18 @@ export default class GeneralRoomSettingsTab extends React.Component; } + let leaveSection; + if (room.getMyMembership() === "join") { + leaveSection = <> + { _t("Leave room") } +
+ + { _t('Leave room') } + +
+ ; + } + return (
{ _t("General") }
@@ -109,17 +121,7 @@ export default class GeneralRoomSettingsTab extends React.Component{ _t("Other") }
{ flairSection } { urlPreviewSettings } - - { _t("Leave room") } -
- - { _t('Leave room') } - -
+ { leaveSection } ); }