Skip to content

Commit

Permalink
regression: Fix rooms table not showing teams (#30361)
Browse files Browse the repository at this point in the history
  • Loading branch information
rique223 authored Sep 14, 2023
1 parent 886631b commit 7ac55bf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/meteor/client/views/admin/rooms/RoomsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ import RoomsTableFilters from './RoomsTableFilters';
type RoomFilters = {
searchText: string;
types: OptionProp[];
visibility: OptionProp[];
};

const DEFAULT_TYPES = ['d', 'p', 'c', 'l', 'discussions', 'teams'];

const RoomsTable = ({ reload }: { reload: MutableRefObject<() => void> }): ReactElement => {
const t = useTranslation();
const mediaQuery = useMediaQuery('(min-width: 1024px)');

const [roomFilters, setRoomFilters] = useState<RoomFilters>({ searchText: '', types: [], visibility: [] });
const [roomFilters, setRoomFilters] = useState<RoomFilters>({ searchText: '', types: [] });

const prevRoomFilterText = useRef<string>(roomFilters.searchText);

Expand All @@ -47,7 +48,7 @@ const RoomsTable = ({ reload }: { reload: MutableRefObject<() => void> }): React
sort: `{ "${sortBy}": ${sortDirection === 'asc' ? 1 : -1} }`,
count: itemsPerPage,
offset: searchText === prevRoomFilterText.current ? current : 0,
types: [...roomFilters.types.map((roomType) => roomType.id)],
types: roomFilters.types.length ? [...roomFilters.types.map((roomType) => roomType.id)] : DEFAULT_TYPES,
};
}, [searchText, sortBy, sortDirection, itemsPerPage, current, roomFilters.types, setCurrent]),
500,
Expand Down

0 comments on commit 7ac55bf

Please sign in to comment.