Fix object filter (#3011)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-04-18 15:49:05 +06:00 committed by GitHub
parent d5f1668532
commit 8a45bd0e2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,7 +112,8 @@
}
if (values.length !== targets.size) {
const oldSize = filter.value.length
filter.value = filter.value.filter((p) => !targets.has(p._id))
const set = new Set(values.map((p) => p?._id))
filter.value = filter.value.filter((p) => set.has(p))
const removed = oldSize - (filter.value.length ?? 0)
if (removed > 0) {
onChange(filter)