Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

editor: fix image query matching all images in editor

Abdullah Atta19a151f637c4
diff --git a/packages/editor/src/extensions/image/component.tsx b/packages/editor/src/extensions/image/component.tsx
index ccd11314a..3dee84e7c 100644
--- a/packages/editor/src/extensions/image/component.tsx
+++ b/packages/editor/src/extensions/image/component.tsx
@@ -308,7 +308,9 @@ export function ImageComponent(
function makeImageQuery(src?: string, hash?: string) {
return (a: Attachment) =>
- (a.type === "image" && a.src === src) || a.hash === hash;
+ a.type === "image" &&
+ ((!!a.src && !!src && a.src === src) ||
+ (!!a.hash && !!hash && a.hash === hash));
}
function canParse(src: string) {
if (!src) return false;