1
0
Fork 0
mirror of synced 2024-07-04 22:11:23 +12:00

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

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`)