From d4bac4752d0eabf8304f6bb310505ad06406233d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 8 Sep 2021 13:34:26 +0100 Subject: [PATCH] Make space members and user info behave more expectedly --- src/components/structures/RightPanel.tsx | 2 +- .../views/context_menus/SpaceContextMenu.tsx | 2 +- src/components/views/right_panel/UserInfo.tsx | 13 ++++++++----- src/i18n/strings/en_EN.json | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/structures/RightPanel.tsx b/src/components/structures/RightPanel.tsx index 67634c63d2..5b12e542bd 100644 --- a/src/components/structures/RightPanel.tsx +++ b/src/components/structures/RightPanel.tsx @@ -269,7 +269,7 @@ export default class RightPanel extends React.Component { case RightPanelPhases.EncryptionPanel: panel = { defaultDispatcher.dispatch({ action: Action.SetRightPanelPhase, phase: RightPanelPhases.SpaceMemberList, - refireParams: { space: space }, + refireParams: { space }, }); onFinished(); }; diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index d15f349d62..f90643f1df 100644 --- a/src/components/views/right_panel/UserInfo.tsx +++ b/src/components/views/right_panel/UserInfo.tsx @@ -1278,7 +1278,9 @@ const BasicUserInfo: React.FC<{ // hide the Roles section for DMs as it doesn't make sense there if (!DMRoomMap.shared().getUserIdForRoomId((member as RoomMember).roomId)) { memberDetails =
-

{ _t("Role") }

+

{ _t("Role in ", {}, { + RoomName: () => { room.name }, + }) }

= ({ // We have no previousPhase for when viewing a UserInfo from a Group or without a Room at this time if (room && phase === RightPanelPhases.EncryptionPanel) { previousPhase = RightPanelPhases.RoomMemberInfo; - refireParams = { member: member }; + refireParams = { member }; + } else if (room?.isSpaceRoom() && SpaceStore.spacesEnabled) { + previousPhase = previousPhase = RightPanelPhases.SpaceMemberList; + refireParams = { space: room }; } else if (room) { - previousPhase = previousPhase = SpaceStore.spacesEnabled && room.isSpaceRoom() - ? RightPanelPhases.SpaceMemberList - : RightPanelPhases.RoomMemberList; + previousPhase = RightPanelPhases.RoomMemberList; } const onEncryptionPanelClose = () => { diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 7d754a618a..10152193a3 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1866,7 +1866,7 @@ "Deactivating this user will log them out and prevent them from logging back in. Additionally, they will leave all the rooms they are in. This action cannot be reversed. Are you sure you want to deactivate this user?": "Deactivating this user will log them out and prevent them from logging back in. Additionally, they will leave all the rooms they are in. This action cannot be reversed. Are you sure you want to deactivate this user?", "Deactivate user": "Deactivate user", "Failed to deactivate user": "Failed to deactivate user", - "Role": "Role", + "Role in ": "Role in ", "This client does not support end-to-end encryption.": "This client does not support end-to-end encryption.", "Edit devices": "Edit devices", "Security": "Security",