1
0
Fork 0
mirror of synced 2024-08-19 03:51:29 +12:00

Fix add component not working on first click when no component is selected

This commit is contained in:
Andrew Kingston 2022-08-13 15:22:54 +01:00
parent 9287d48ccf
commit 62e01a299e

View file

@ -186,7 +186,7 @@
$goto("./navigation")
}
} else if (type === "request-add-component") {
$goto(`./components/${$selectedComponent?._id}/new`)
toggleAddComponent()
} else if (type === "highlight-setting") {
store.actions.settings.highlight(data.setting)
@ -230,9 +230,8 @@
if (isAddingComponent) {
$goto(`../${$selectedScreen._id}/components/${$selectedComponent?._id}`)
} else {
$goto(
`../${$selectedScreen._id}/components/${$selectedComponent?._id}/new`
)
const id = $selectedComponent?._id || $selectedScreen?.props?._id
$goto(`../${$selectedScreen._id}/components/${id}/new`)
}
}