Lint
This commit is contained in:
parent
49948df9cd
commit
46a9f98fe5
|
@ -9,7 +9,7 @@
|
|||
</script>
|
||||
|
||||
<script>
|
||||
import { getContext, setContext, onMount, onDestroy } from "svelte"
|
||||
import { getContext, setContext, onMount } from "svelte"
|
||||
import { writable, get } from "svelte/store"
|
||||
import {
|
||||
enrichProps,
|
||||
|
@ -86,7 +86,6 @@
|
|||
|
||||
// Keep track of stringified representations of context and instance
|
||||
// to avoid enriching bindings as much as possible
|
||||
let lastContextKey
|
||||
let lastInstanceKey
|
||||
|
||||
// Visibility flag used by conditional UI
|
||||
|
@ -540,33 +539,30 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Register an unregister component instance
|
||||
onMount(() => {
|
||||
if (
|
||||
$appStore.isDevApp &&
|
||||
!componentStore.actions.isComponentRegistered(id)
|
||||
) {
|
||||
componentStore.actions.registerInstance(id, {
|
||||
component: instance._component,
|
||||
getSettings: () => cachedSettings,
|
||||
getRawSettings: () => ({ ...staticSettings, ...dynamicSettings }),
|
||||
getDataContext: () => get(context),
|
||||
reload: () => initialise(instance, true),
|
||||
setEphemeralStyles: styles => (ephemeralStyles = styles),
|
||||
state: store,
|
||||
})
|
||||
if ($appStore.isDevApp) {
|
||||
if (!componentStore.actions.isComponentRegistered(id)) {
|
||||
componentStore.actions.registerInstance(id, {
|
||||
component: instance._component,
|
||||
getSettings: () => cachedSettings,
|
||||
getRawSettings: () => ({ ...staticSettings, ...dynamicSettings }),
|
||||
getDataContext: () => get(context),
|
||||
reload: () => initialise(instance, true),
|
||||
setEphemeralStyles: styles => (ephemeralStyles = styles),
|
||||
state: store,
|
||||
})
|
||||
}
|
||||
return () => {
|
||||
if (componentStore.actions.isComponentRegistered(id)) {
|
||||
componentStore.actions.unregisterInstance(id)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// Observe changes to context
|
||||
onMount(() => context.actions.observeChanges(handleContextChange))
|
||||
|
||||
onDestroy(() => {
|
||||
if (
|
||||
$appStore.isDevApp &&
|
||||
componentStore.actions.isComponentRegistered(id)
|
||||
) {
|
||||
componentStore.actions.unregisterInstance(id)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
{#if constructor && initialSettings && (visible || inSelectedPath) && !builderHidden}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { dayjs } from "dayjs"
|
||||
import dayjs from "dayjs"
|
||||
import { CoreDatePicker, Icon } from "@budibase/bbui"
|
||||
import { onMount } from "svelte"
|
||||
|
||||
|
|
Loading…
Reference in New Issue