1
0
Fork 0
mirror of synced 2024-09-08 13:41:09 +12:00

Use order as key when registering block components rather than ID

This commit is contained in:
Andrew Kingston 2022-08-23 19:37:38 +01:00
parent 6d77b67cfa
commit 27ab8b8e82
2 changed files with 2 additions and 2 deletions

View file

@ -14,7 +14,7 @@
}
// Remove existing instance of this component in case props changed
structureLookupMap[parentId] = structureLookupMap[parentId].filter(
blockComponent => blockComponent.instance._id !== id
blockComponent => blockComponent.order !== order
)
// Add new instance of this component
structureLookupMap[parentId].push({ order, instance })

View file

@ -39,7 +39,7 @@
// ejected later
$: {
if ($builderStore.inBuilder) {
block.registerComponent(id, order, $component?.id, instance)
block.registerComponent(id, order ?? 0, $component?.id, instance)
}
}
</script>