Skip to content

Commit 049c49f

Browse files
committed
feat: hide favourites and low priority filters
1 parent fe932d2 commit 049c49f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

apps/web/src/viewmodels/room-list/RoomListViewModel.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { hasCreateRoomRights } from "./utils";
3434
import { keepIfSame } from "../../utils/keepIfSame";
3535
import { DefaultTagID } from "../../stores/room-list-v3/skip-list/tag";
3636
import { RoomListSectionHeaderViewModel } from "./RoomListSectionHeaderViewModel";
37+
import SettingsStore from "../../settings/SettingsStore";
3738

3839
interface 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);

0 commit comments

Comments
 (0)