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