From 37fe8c2ab6fe677f701adb0994b255e31e33df23 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 7 Apr 2021 15:10:03 +0100 Subject: [PATCH] Only hydrate state from URL once in design section to avoid cycles --- .../[application]/design/[assetType]/_layout.svelte | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/builder/src/pages/builder/[application]/design/[assetType]/_layout.svelte b/packages/builder/src/pages/builder/[application]/design/[assetType]/_layout.svelte index 16f0a8323d..87fbb46586 100644 --- a/packages/builder/src/pages/builder/[application]/design/[assetType]/_layout.svelte +++ b/packages/builder/src/pages/builder/[application]/design/[assetType]/_layout.svelte @@ -18,6 +18,7 @@ let previousType let previousAsset let previousComponentId + let hydrationComplete = false // Hydrate state from URL params $: hydrateStateFromURL($params, $leftover) @@ -30,6 +31,12 @@ ) const hydrateStateFromURL = (params, leftover) => { + if (hydrationComplete) { + return + } else { + hydrationComplete = true + } + // Do nothing if no asset type, as that means we've left the page if (!params.assetType) { return