Only hydrate state from URL once in design section to avoid cycles
This commit is contained in:
parent
e897a5ae61
commit
799a5285e3
|
@ -18,6 +18,7 @@
|
||||||
let previousType
|
let previousType
|
||||||
let previousAsset
|
let previousAsset
|
||||||
let previousComponentId
|
let previousComponentId
|
||||||
|
let hydrationComplete = false
|
||||||
|
|
||||||
// Hydrate state from URL params
|
// Hydrate state from URL params
|
||||||
$: hydrateStateFromURL($params, $leftover)
|
$: hydrateStateFromURL($params, $leftover)
|
||||||
|
@ -30,6 +31,12 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
const hydrateStateFromURL = (params, leftover) => {
|
const hydrateStateFromURL = (params, leftover) => {
|
||||||
|
if (hydrationComplete) {
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
hydrationComplete = true
|
||||||
|
}
|
||||||
|
|
||||||
// Do nothing if no asset type, as that means we've left the page
|
// Do nothing if no asset type, as that means we've left the page
|
||||||
if (!params.assetType) {
|
if (!params.assetType) {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue