diff --git a/packages/builder/src/pages/[application]/design/[assetType]/[asset]/_layout.svelte b/packages/builder/src/pages/[application]/design/[assetType]/[asset]/_layout.svelte index baa253ce9f..1080021ed1 100644 --- a/packages/builder/src/pages/[application]/design/[assetType]/[asset]/_layout.svelte +++ b/packages/builder/src/pages/[application]/design/[assetType]/[asset]/_layout.svelte @@ -8,6 +8,11 @@ let initialised = false + // Cache previous values so we don't update the URL more than necessary + let previousType + let previousAsset + let previousComponentId + // Hydrate state from query param on mount onMount(() => { const assetId = decodeURI($params.asset) @@ -48,6 +53,19 @@ return } + // Check we have different params than last invocation + if ( + assetType === previousType && + asset === previousAsset && + componentId === previousComponentId + ) { + return + } else { + previousType = assetType + previousAsset = asset + previousComponentId = componentId + } + // Extract current URL params const currentParams = get(params) const currentLeftover = get(leftover)