Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit b9cca46

Browse files
authored
Merge pull request #5918 from matrix-org/t3chguy/fix/17050
Fix add existing to space dialog no longer showing rooms for public spaces
2 parents 62f8c9a + 1c7d68b commit b9cca46

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/components/views/dialogs/AddExistingToSpaceDialog.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,13 @@ const AddExistingToSpaceDialog: React.FC<IProps> = ({ matrixClient: cli, space,
6868
if (room !== space && room !== selectedSpace && !existingSubspacesSet.has(room)) {
6969
arr[0].push(room);
7070
}
71-
} else if (!existingRoomsSet.has(room) && joinRule !== "public") {
72-
// Only show DMs for non-public spaces as they make very little sense in spaces other than "Just Me" ones.
73-
arr[DMRoomMap.shared().getUserIdForRoomId(room.roomId) ? 2 : 1].push(room);
71+
} else if (!existingRoomsSet.has(room)) {
72+
if (!DMRoomMap.shared().getUserIdForRoomId(room.roomId)) {
73+
arr[1].push(room);
74+
} else if (joinRule !== "public") {
75+
// Only show DMs for non-public spaces as they make very little sense in spaces other than "Just Me" ones.
76+
arr[2].push(room);
77+
}
7478
}
7579
return arr;
7680
}, [[], [], []]);

0 commit comments

Comments
 (0)