Change Special filter fix (#1990)

Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
Denis Bykhov 2022-06-02 22:59:49 +06:00 committed by GitHub
parent 30a9186eab
commit 03eec41a03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -59,6 +59,13 @@
)
}
$: clear(_class)
function clear (_class: Ref<Class<Doc>>) {
filters.map((p) => p.onRemove?.())
filters = []
}
function remove (i: number) {
filters[i]?.onRemove?.()
filters.splice(i, 1)

View File

@ -22,6 +22,7 @@
import { getClient } from '@anticrm/presentation'
import task from '@anticrm/task'
import type { State } from '@anticrm/task'
import { onDestroy } from 'svelte'
export let _class: Ref<Class<Doc>>
export let filter: Filter
@ -57,6 +58,10 @@
filter = filter
dispatch('change')
}
onDestroy(() => {
filter.onRemove?.()
})
</script>
<div class="filter-section">