diff --git a/src/components/Editor/CustomExtensions/Embeds/EmbedComponent.jsx b/src/components/Editor/CustomExtensions/Embeds/EmbedComponent.jsx index e463d663..f9f1b2f6 100644 --- a/src/components/Editor/CustomExtensions/Embeds/EmbedComponent.jsx +++ b/src/components/Editor/CustomExtensions/Embeds/EmbedComponent.jsx @@ -39,6 +39,7 @@ const EmbedComponent = ({ return ( { - if (node.attrs.id === id) { - const transaction = view.state.tr.setNodeMarkup( - pos, - null, - { src: url } - ); - view.dispatch(transaction); - } + if (!(node.attrs.id === id)) return; + const transaction = view.state.tr.setNodeMarkup( + pos, + null, + { src: url } + ); + view.dispatch(transaction); }); } catch { view.dispatch(view.state.tr.delete(pos, pos + 1)); diff --git a/src/components/Editor/CustomExtensions/Image/Menu.jsx b/src/components/Editor/CustomExtensions/Image/Menu.jsx index 87f632aa..b7ed5cb3 100644 --- a/src/components/Editor/CustomExtensions/Image/Menu.jsx +++ b/src/components/Editor/CustomExtensions/Image/Menu.jsx @@ -25,6 +25,7 @@ const Menu = ({ align, editor, updateAttributes, deleteNode }) => { > {menuOptions.map(({ Icon, optionName, alignPos }) => (