Fix filter removing values (#2940)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-04-11 16:16:44 +06:00 committed by GitHub
parent fdae734430
commit 2574918a32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,10 +109,13 @@
}
const oldSize = filter.value.length
filter.value = filter.value.filter((p) => !targets.has(p._id))
onChange(filter)
addNotification(await translate(view.string.FilterUpdated, {}), filter.key.label, FilterRemovedNotification, {
description: await translate(view.string.FilterRemoved, { count: oldSize - (filter.value.length ?? 0) })
})
const removed = oldSize - (filter.value.length ?? 0)
if (removed > 0) {
onChange(filter)
addNotification(await translate(view.string.FilterUpdated, {}), filter.key.label, FilterRemovedNotification, {
description: await translate(view.string.FilterRemoved, { count: removed })
})
}
}
if (isStatus) {
values = groupValues(values as Status[])