mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-18 12:17:03 +02:00
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:
parent
149b3b1049
commit
ac3667508f
@ -11,7 +11,7 @@ import { RoomNotificationStateStore } from "../../../notifications/RoomNotificat
|
|||||||
|
|
||||||
export class MentionsFilter implements Filter {
|
export class MentionsFilter implements Filter {
|
||||||
public matches(room: Room): boolean {
|
public matches(room: Room): boolean {
|
||||||
return RoomNotificationStateStore.instance.getRoomState(room).hasMentions;
|
return RoomNotificationStateStore.instance.getRoomState(room).isMention;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get key(): FilterKey.MentionsFilter {
|
public get key(): FilterKey.MentionsFilter {
|
||||||
|
@ -570,7 +570,7 @@ describe("RoomListStoreV3", () => {
|
|||||||
// Let's say 8, 27 have mentions
|
// Let's say 8, 27 have mentions
|
||||||
jest.spyOn(RoomNotificationStateStore.instance, "getRoomState").mockImplementation((room) => {
|
jest.spyOn(RoomNotificationStateStore.instance, "getRoomState").mockImplementation((room) => {
|
||||||
const state = {
|
const state = {
|
||||||
hasMentions: [rooms[8], rooms[27]].includes(room),
|
isMention: [rooms[8], rooms[27]].includes(room),
|
||||||
} as unknown as RoomNotificationState;
|
} as unknown as RoomNotificationState;
|
||||||
return state;
|
return state;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user