1
0
Fork 0
mirror of synced 2024-07-01 12:30:41 +12:00

Only hydrate state from URL once in design section to avoid cycles

This commit is contained in:
Andrew Kingston 2021-04-07 15:10:03 +01:00
parent e897a5ae61
commit 799a5285e3

View file

@ -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