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

Fix add existing space not showing any spaces #7751

Merged
merged 2 commits into from
Feb 8, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/components/views/dialogs/AddExistingToSpaceDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ export const AddExistingToSpace: React.FC<IAddExistingToSpaceProps> = ({

// only count spaces when alone as they're shown on a separate modal all on their own
const numSpaces = (spacesRenderer && !dmsRenderer && !roomsRenderer) ? spaces.length : 0;
const numRooms = roomsRenderer ? rooms.length : 0;
const numDms = dmsRenderer ? dms.length : 0;

let noResults = true;
if ((roomsRenderer && rooms.length > 0) || (dmsRenderer && dms.length > 0) || (numSpaces > 0)) {
t3chguy marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -287,9 +289,9 @@ export const AddExistingToSpace: React.FC<IAddExistingToSpaceProps> = ({
});
};

const roomsScrollState = getScrollState(scrollState, rooms.length);
const spacesScrollState = getScrollState(scrollState, numSpaces, rooms.length);
const dmsScrollState = getScrollState(scrollState, dms.length, numSpaces, rooms.length);
const roomsScrollState = getScrollState(scrollState, numRooms);
const spacesScrollState = getScrollState(scrollState, numSpaces, numRooms);
const dmsScrollState = getScrollState(scrollState, numDms, numSpaces, numRooms);

return <div className="mx_AddExistingToSpace">
<SearchBox
Expand Down