A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
editor: fix crash on loading web clip
Abdullah Atta8dada6d93600
diff --git a/packages/editor/src/extensions/web-clip/component.tsx b/packages/editor/src/extensions/web-clip/component.tsxindex 5395a513c..ac8bfea7d 100644--- a/packages/editor/src/extensions/web-clip/component.tsx+++ b/packages/editor/src/extensions/web-clip/component.tsx@@ -45,12 +45,14 @@ export function WebClipComponent(useEffect(() => {(async function () {- const iframe = embedRef.current;- if (!iframe || !iframe.contentDocument || !isLoading) return;+ if (!isLoading) return;const html = await editor.storage.getAttachmentData?.(node.attrs).catch(() => null);++ const iframe = embedRef.current;+ if (!iframe || !iframe.contentDocument) return;iframe.contentDocument.open();iframe.contentDocument.write(typeof html !== "string" || !html ? FAILED_CONTENT : html@@ -87,12 +89,15 @@ export function WebClipComponent(useEffect(() => {if (embedRef.current?.contentDocument) {resizeObserverRef.current = new ResizeObserver(() => {- resizeIframe(node.attrs, embedRef.current);+ setTimeout(() => resizeIframe(node.attrs, embedRef.current), 100);});resizeObserverRef.current.observe(embedRef.current?.contentDocument?.body);}+ return () => {+ resizeObserverRef.current?.disconnect();+ };}, []);return (