From c353b6daadf5fde1f6e3ab0eaae97146e3723358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 26 Aug 2021 17:39:48 +0200 Subject: [PATCH 1/2] Render guest settings only in public rooms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- .../tabs/room/SecurityRoomSettingsTab.tsx | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx index d9e97d570b0..cade206dadc 100644 --- a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx @@ -616,6 +616,22 @@ export default class SecurityRoomSettingsTab extends React.Component + + { this.state.showAdvancedSection ? _t("Hide advanced") : _t("Show advanced") } + + { this.state.showAdvancedSection && this.renderAdvanced() } + + ); + } + return (
{ _t("Security & Privacy") }
@@ -641,15 +657,7 @@ export default class SecurityRoomSettingsTab extends React.Component - - { this.state.showAdvancedSection ? _t("Hide advanced") : _t("Show advanced") } - - { this.state.showAdvancedSection && this.renderAdvanced() } - + { advanced } { historySection }
); From 4f1ff134dc9b7505dc21e6e64d61ebe0b84c99dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 26 Aug 2021 17:39:54 +0200 Subject: [PATCH 2/2] Render guest settings only in public spaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- .../spaces/SpaceSettingsVisibilityTab.tsx | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx b/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx index b48f5c79c68..90d598cb168 100644 --- a/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx +++ b/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx @@ -94,30 +94,32 @@ const SpaceSettingsVisibilityTab = ({ matrixClient: cli, space }: IProps) => { const canonicalAliasEv = space.currentState.getStateEvents(EventType.RoomCanonicalAlias, ""); let advancedSection; - if (showAdvancedSection) { - advancedSection = <> - - { _t("Hide advanced") } - - - -

- { _t("Guests can join a space without having an account.") } -
- { _t("This may be useful for public spaces.") } -

- ; - } else { - advancedSection = <> - - { _t("Show advanced") } - - ; + if (visibility === SpaceVisibility.Unlisted) { + if (showAdvancedSection) { + advancedSection = <> + + { _t("Hide advanced") } + + + +

+ { _t("Guests can join a space without having an account.") } +
+ { _t("This may be useful for public spaces.") } +

+ ; + } else { + advancedSection = <> + + { _t("Show advanced") } + + ; + } } let addressesSection;