From 4082a037697e559938c8163a5e19d10a96f806eb Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 19 Apr 2021 17:32:15 +0100 Subject: [PATCH] Fix typo in method call in add existing to space dialog --- src/components/views/dialogs/AddExistingToSpaceDialog.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/AddExistingToSpaceDialog.tsx b/src/components/views/dialogs/AddExistingToSpaceDialog.tsx index 7ea6b43194..0f58a624f3 100644 --- a/src/components/views/dialogs/AddExistingToSpaceDialog.tsx +++ b/src/components/views/dialogs/AddExistingToSpaceDialog.tsx @@ -59,6 +59,7 @@ const AddExistingToSpaceDialog: React.FC = ({ matrixClient: cli, space, const existingSubspacesSet = new Set(existingSubspaces); const existingRoomsSet = new Set(SpaceStore.instance.getChildRooms(space.roomId)); + const joinRule = selectedSpace.getJoinRule(); const [spaces, rooms, dms] = cli.getVisibleRooms().reduce((arr, room) => { if (room.getMyMembership() !== "join") return arr; if (!room.name.toLowerCase().includes(lcQuery)) return arr; @@ -67,7 +68,7 @@ const AddExistingToSpaceDialog: React.FC = ({ matrixClient: cli, space, if (room !== space && room !== selectedSpace && !existingSubspacesSet.has(room)) { arr[0].push(room); } - } else if (!existingRoomsSet.has(room) && selectedSpace.joinRule() !== "public") { + } else if (!existingRoomsSet.has(room) && joinRule !== "public") { // Only show DMs for non-public spaces as they make very little sense in spaces other than "Just Me" ones. arr[DMRoomMap.shared().getUserIdForRoomId(room.roomId) ? 2 : 1].push(room); }