Hi! This code is to reinsert an image after it has deleted and the undo command. It should be placed again in a list of attachments that receives info of the images added on the editor. So I'm capturing the deleted nodes info and creating the node back:
Relevant part is the if block "if (props.createMode)".
If I pass a COMMAND_PRIORITY_EDITOR, the imageNode is added back to the editor, but the line "onUploadImage(nodeValue.storageToken, nodeValue.storageKey, nodeValue.altText, nodeValue.sizeString);" is not executed.
Using all the other priorities, the line is executed, but the node is not created.
Hi! This code is to reinsert an image after it has deleted and the undo command. It should be placed again in a list of attachments that receives info of the images added on the editor. So I'm capturing the deleted nodes info and creating the node back:
`export default function ImagesPlugin(props) { const [editor] = useLexicalComposerContext(); const { settings: { uploadImageUrl, onUploadImage, onReaddImage, }, } = useSettings();
}`
Relevant part is the if block "if (props.createMode)". If I pass a COMMAND_PRIORITY_EDITOR, the imageNode is added back to the editor, but the line "onUploadImage(nodeValue.storageToken, nodeValue.storageKey, nodeValue.altText, nodeValue.sizeString);" is not executed. Using all the other priorities, the line is executed, but the node is not created.
What is changing this behavior? Thanks