mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-29 04:55:03 +02:00
Load active viewlet (#2994)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -88,8 +88,15 @@
|
||||
})
|
||||
)
|
||||
|
||||
$: {
|
||||
const newViewlet = viewlets.find((viewlet) => viewlet?._id === $activeViewlet[key]) ?? viewlets[0]
|
||||
$: getActiveViewlet(viewlets, $activeViewlet, key)
|
||||
|
||||
function getActiveViewlet (
|
||||
viewlets: WithLookup<Viewlet>[],
|
||||
activeViewlet: Record<string, Ref<Viewlet> | null>,
|
||||
key: string
|
||||
) {
|
||||
if (viewlets.length === 0) return
|
||||
const newViewlet = viewlets.find((viewlet) => viewlet?._id === activeViewlet[key]) ?? viewlets[0]
|
||||
if (viewlet?._id !== newViewlet?._id) {
|
||||
preference = undefined
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user