diff --git a/plugins/view-resources/src/components/filter/FilterButton.svelte b/plugins/view-resources/src/components/filter/FilterButton.svelte index 136d630369..e3f0593153 100644 --- a/plugins/view-resources/src/components/filter/FilterButton.svelte +++ b/plugins/view-resources/src/components/filter/FilterButton.svelte @@ -21,6 +21,7 @@ import view from '../../plugin' import FilterTypePopup from './FilterTypePopup.svelte' import IconClose from '../icons/Close.svelte' + import { onDestroy } from 'svelte' export let _class: Ref> | undefined export let space: Ref | undefined = undefined @@ -51,6 +52,10 @@ if (e !== undefined) setFilters([e]) } + onDestroy(() => { + _class = undefined + }) + function add (e: MouseEvent) { const target = eventToHTMLElement(e) showPopup( diff --git a/plugins/workbench-resources/src/components/SavedView.svelte b/plugins/workbench-resources/src/components/SavedView.svelte index a89588a1c0..bb4c520f2a 100644 --- a/plugins/workbench-resources/src/components/SavedView.svelte +++ b/plugins/workbench-resources/src/components/SavedView.svelte @@ -110,7 +110,6 @@ query: fv.location.query ?? undefined, fragment: fv.location.fragment ?? undefined }) - setFilters(JSON.parse(fv.filters)) if (fv.viewletId !== undefined && fv.viewletId !== null) { const viewlet = await client.findOne(view.class.Viewlet, { _id: fv.viewletId }) setActiveViewletId(fv.viewletId, fv.location) @@ -118,6 +117,7 @@ setViewOptions(viewlet, copy(fv.viewOptions)) } } + setFilters(JSON.parse(fv.filters)) } const clearSelection = () => {