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 8643bb1553
commit 853f9fd268
1 changed files with 2 additions and 2 deletions

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,