Fix add existing to space dialog showing all spaces additionally as rooms

pull/21833/head
Michael Telatynski 2021-03-18 13:17:30 +00:00
parent 31ce19373b
commit 88b7c8f53d
1 changed files with 1 additions and 0 deletions

View File

@ -69,6 +69,7 @@ const AddExistingToSpaceDialog: React.FC<IProps> = ({ matrixClient: cli, space,
const existingRoomsSet = new Set(existingRooms);
const rooms = cli.getVisibleRooms().filter(room => {
return !existingRoomsSet.has(room) // not already in space
&& !room.isSpaceRoom() // not a space itself
&& room.name.toLowerCase().includes(lcQuery) // contains query
&& !DMRoomMap.shared().getUserIdForRoomId(room.roomId); // not a DM
});