Use order as key when registering block components rather than ID
This commit is contained in:
parent
6d77b67cfa
commit
27ab8b8e82
|
@ -14,7 +14,7 @@
|
||||||
}
|
}
|
||||||
// Remove existing instance of this component in case props changed
|
// Remove existing instance of this component in case props changed
|
||||||
structureLookupMap[parentId] = structureLookupMap[parentId].filter(
|
structureLookupMap[parentId] = structureLookupMap[parentId].filter(
|
||||||
blockComponent => blockComponent.instance._id !== id
|
blockComponent => blockComponent.order !== order
|
||||||
)
|
)
|
||||||
// Add new instance of this component
|
// Add new instance of this component
|
||||||
structureLookupMap[parentId].push({ order, instance })
|
structureLookupMap[parentId].push({ order, instance })
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
// ejected later
|
// ejected later
|
||||||
$: {
|
$: {
|
||||||
if ($builderStore.inBuilder) {
|
if ($builderStore.inBuilder) {
|
||||||
block.registerComponent(id, order, $component?.id, instance)
|
block.registerComponent(id, order ?? 0, $component?.id, instance)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue