mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-23 14:06:00 +03:00
UBER-646: clear the class when view is changed to prevent using old one (#3541)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
315d20480b
commit
3c376696f6
@ -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<Class<Doc>> | undefined
|
||||
export let space: Ref<Space> | undefined = undefined
|
||||
@ -51,6 +52,10 @@
|
||||
if (e !== undefined) setFilters([e])
|
||||
}
|
||||
|
||||
onDestroy(() => {
|
||||
_class = undefined
|
||||
})
|
||||
|
||||
function add (e: MouseEvent) {
|
||||
const target = eventToHTMLElement(e)
|
||||
showPopup(
|
||||
|
@ -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 = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user