1
0
Fork 0
mirror of synced 2024-07-02 13:01:09 +12:00

bugfix: delete component sometimes breaks navigation

This commit is contained in:
Michael Shanks 2020-07-06 11:17:54 +01:00
parent fbdd159c56
commit 3fc9fbfd39

View file

@ -38,15 +38,21 @@
// Loop through each ID
ids.forEach(id => {
// Find ID and select it
componentToSelect = currentChildren.find(child => child._id === id)
// Find ID
const component = currentChildren.find(child => child._id === id)
// If it does not exist, ignore (use last valid route)
if (!component) return
componentToSelect = component
// Update childrens array to selected components children
currentChildren = componentToSelect._children
})
// Select Component!
store.selectComponent(componentToSelect)
if (componentToSelect)
store.selectComponent(componentToSelect)
}
</script>