1
0
Fork 0
mirror of synced 2024-06-14 08:24:48 +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 4957f335b7
commit 2f2c28cf4d
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>