Ignore calls to eject via keyboard shortcut ctrl+e is not an ejectable block

This commit is contained in:
Dean 2024-01-10 15:38:49 +00:00
parent 47e04c363c
commit ae1786786b
1 changed files with 9 additions and 2 deletions

View File

@ -32,8 +32,15 @@
await store.actions.components.paste(component, "below")
},
["Ctrl+e"]: component => {
componentToEject = component
confirmEjectDialog.show()
const definition = store.actions.components.getDefinition(
component._component
)
const isBlock = definition?.block === true
const canEject = !(definition?.ejectable === false)
if (isBlock && canEject) {
componentToEject = component
confirmEjectDialog.show()
}
},
["Ctrl+Enter"]: () => {
$goto(`./:componentId/new`)