1
0
Fork 0
mirror of synced 2024-07-01 04:21:06 +12:00

Don't fire on load events when working in the builder preview

This commit is contained in:
Andrew Kingston 2022-06-21 09:38:57 +01:00
parent 030f5ce6bd
commit 67eecf4d8e

View file

@ -1,5 +1,5 @@
<script> <script>
import { screenStore, routeStore } from "stores" import { screenStore, routeStore, builderStore } from "stores"
import Component from "./Component.svelte" import Component from "./Component.svelte"
import Provider from "./context/Provider.svelte" import Provider from "./context/Provider.svelte"
import { onMount, getContext } from "svelte" import { onMount, getContext } from "svelte"
@ -24,7 +24,7 @@
// Enrich and execute and on load actions. // Enrich and execute and on load actions.
// We manually construct the full context here as this component is the // We manually construct the full context here as this component is the
// one that provides the url context, so it is not available in $context yet // one that provides the url context, so it is not available in $context yet
if ($screenStore.activeScreen?.onLoad) { if ($screenStore.activeScreen?.onLoad && !$builderStore.inBuilder) {
const actions = enrichButtonActions($screenStore.activeScreen.onLoad, { const actions = enrichButtonActions($screenStore.activeScreen.onLoad, {
...$context, ...$context,
url: params, url: params,