mirror of
https://github.com/irislib/iris-messenger.git
synced 2024-10-18 06:03:22 +00:00
keywords filter
This commit is contained in:
parent
35951f64ee
commit
b0ea08abf9
@ -20,6 +20,11 @@ const useSubscribe = (ops: {
|
|||||||
|
|
||||||
const handleEvent = (event: Event) => {
|
const handleEvent = (event: Event) => {
|
||||||
if (sortedEvents.current.has(event.id)) return;
|
if (sortedEvents.current.has(event.id)) return;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore
|
||||||
|
if (filter.keywords && !filter.keywords.some((keyword) => event.content?.includes(keyword))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
sortedEvents.current.add(event);
|
sortedEvents.current.add(event);
|
||||||
setEvents(sortedEvents.current.events());
|
setEvents(sortedEvents.current.events());
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user