Limit tracker changes on deriveEventsByIdForUrl to the given url
This commit is contained in:
@@ -300,16 +300,18 @@ export const deriveEventsByIdForUrl = ({
|
|||||||
set(eventsById)
|
set(eventsById)
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
on(tracker, "add", (id: string, url: string) => {
|
on(tracker, "add", (id: string, trackedUrl: string) => {
|
||||||
const event = repository.getEvent(id)
|
if (trackedUrl === url) {
|
||||||
|
const event = repository.getEvent(id)
|
||||||
|
|
||||||
if (event && tracker.hasRelay(id, url) && matchFilters(filters, event)) {
|
if (event && tracker.hasRelay(id, trackedUrl) && matchFilters(filters, event)) {
|
||||||
eventsById.set(id, event)
|
eventsById.set(id, event)
|
||||||
set(eventsById)
|
set(eventsById)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
on(tracker, "remove", (id: string, url: string) => {
|
on(tracker, "remove", (id: string, trackedUrl: string) => {
|
||||||
if (eventsById.has(id)) {
|
if (trackedUrl === url && eventsById.has(id)) {
|
||||||
eventsById.delete(id)
|
eventsById.delete(id)
|
||||||
set(eventsById)
|
set(eventsById)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user