File tree Expand file tree Collapse file tree
apps/web/src/viewmodels/room-list Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import { hasCreateRoomRights } from "./utils";
3434import { keepIfSame } from "../../utils/keepIfSame" ;
3535import { DefaultTagID } from "../../stores/room-list-v3/skip-list/tag" ;
3636import { RoomListSectionHeaderViewModel } from "./RoomListSectionHeaderViewModel" ;
37+ import SettingsStore from "../../settings/SettingsStore" ;
3738
3839interface RoomListViewModelProps {
3940 client : MatrixClient ;
@@ -76,7 +77,12 @@ export class RoomListViewModel
7677 // Get initial rooms
7778 const roomsResult = RoomListStoreV3 . instance . getSortedRoomsInActiveSpace ( undefined ) ;
7879 const canCreateRoom = hasCreateRoomRights ( props . client , activeSpace ) ;
79- const filterIds = [ ...filterKeyToIdMap . values ( ) ] ;
80+
81+ // Remove favourite and low priority filters if sections are enabled, as they are redundant with the sections
82+ const areSectionsEnabled = SettingsStore . getValue ( "feature_room_list_sections" ) ;
83+ const filterIds = [ ...filterKeyToIdMap . values ( ) ] . filter (
84+ ( id ) => ! areSectionsEnabled || ( id !== "favourite" && id !== "low_priority" ) ,
85+ ) ;
8086
8187 // By default, all sections are expanded
8288 const { sections, isFlatList } = computeSections ( roomsResult , ( tag ) => true ) ;
You can’t perform that action at this time.
0 commit comments