Skip to content

Commit

Permalink
fix: return for old images
Browse files Browse the repository at this point in the history
  • Loading branch information
Palanikannan1437 committed Oct 18, 2024
1 parent 028443e commit dd7e726
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const CustomImageBlock: React.FC<CustomImageBlockProps> = (props) => {
}
}
setInitialResizeComplete(true);
}, [nodeWidth, updateAttributes, editorContainer, nodeAspectRatio, size.aspectRatio]);
}, [nodeWidth, updateAttributes, editorContainer, nodeAspectRatio]);

// for real time resizing
useLayoutEffect(() => {
Expand Down Expand Up @@ -241,6 +241,7 @@ export const CustomImageBlock: React.FC<CustomImageBlockProps> = (props) => {
// for old image extension this command doesn't exist
if (!editor?.commands.restoreImage) {
setFailedToLoadImage(true);
return;
}

try {
Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/core/extensions/image/extension.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export const ImageExtension = (fileHandler: TFileHandler) => {
const imageSources = new Set<string>();
this.editor.state.doc.descendants((node) => {
if (node.type.name === this.name) {
console.log("node", node.attrs.src?.startsWith("http"));
if (!node.attrs.src?.startsWith("http")) {
return;
}
Expand Down

0 comments on commit dd7e726

Please sign in to comment.