New Room List: Fix mentions filter matching rooms with any highlight (#29668)

* Use new isMention instead of deprecated hasMention

So that only rooms with mentions (think @ symbol) are shown.

* Fix test
This commit is contained in:
R Midhun Suresh 2025-04-03 18:26:06 +05:30 committed by GitHub
parent 149b3b1049
commit ac3667508f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ import { RoomNotificationStateStore } from "../../../notifications/RoomNotificat
export class MentionsFilter implements Filter {
public matches(room: Room): boolean {
return RoomNotificationStateStore.instance.getRoomState(room).hasMentions;
return RoomNotificationStateStore.instance.getRoomState(room).isMention;
}
public get key(): FilterKey.MentionsFilter {

View File

@ -570,7 +570,7 @@ describe("RoomListStoreV3", () => {
// Let's say 8, 27 have mentions
jest.spyOn(RoomNotificationStateStore.instance, "getRoomState").mockImplementation((room) => {
const state = {
hasMentions: [rooms[8], rooms[27]].includes(room),
isMention: [rooms[8], rooms[27]].includes(room),
} as unknown as RoomNotificationState;
return state;
});