bugfix: delete component sometimes breaks navigation
This commit is contained in:
parent
ec594234d8
commit
fee6985f33
|
@ -38,14 +38,20 @@
|
|||
|
||||
// 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!
|
||||
if (componentToSelect)
|
||||
store.selectComponent(componentToSelect)
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue