From 9fb1e593ea6529a86389d8248c9bd86a03fba7cc Mon Sep 17 00:00:00 2001 From: rique223 Date: Tue, 12 Sep 2023 11:01:20 -0300 Subject: [PATCH] fix: :bug: Rooms table not showing teams and more Fixed a bug in which the rooms page table would not show teams and also removed some unnecessary old filter related code. --- apps/meteor/client/views/admin/rooms/RoomsTable.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/meteor/client/views/admin/rooms/RoomsTable.tsx b/apps/meteor/client/views/admin/rooms/RoomsTable.tsx index c480fab9f657..094ccb95857a 100644 --- a/apps/meteor/client/views/admin/rooms/RoomsTable.tsx +++ b/apps/meteor/client/views/admin/rooms/RoomsTable.tsx @@ -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({ searchText: '', types: [], visibility: [] }); + const [roomFilters, setRoomFilters] = useState({ searchText: '', types: [] }); const prevRoomFilterText = useRef(roomFilters.searchText); @@ -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,