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
fix: crash on image select
thecodrr526933455ede
diff --git a/packages/editor/dist/toolbar/tools/image.js b/packages/editor/dist/toolbar/tools/image.jsindex 889fe281f..233668634 100644--- a/packages/editor/dist/toolbar/tools/image.js+++ b/packages/editor/dist/toolbar/tools/image.js@@ -34,13 +34,12 @@ import { useToolbarLocation } from "../stores/toolbar-store";import { ImageProperties as ImagePropertiesPopup } from "../popups/image-properties";import { findSelectedNode } from "../utils/prosemirror";export function ImageSettings(props) {+ var _a, _b;var editor = props.editor;var isBottom = useToolbarLocation() === "bottom";if (!editor.isActive("image") || !isBottom)return null;- var image = useMemo(function () { return findSelectedNode(editor, "image"); }, []);- var float = ((image === null || image === void 0 ? void 0 : image.attrs) || {}).float;- return (_jsx(MoreTools, __assign({}, props, { autoCloseOnUnmount: true, popupId: "imageSettings", tools: float+ return (_jsx(MoreTools, __assign({}, props, { autoCloseOnUnmount: true, popupId: "imageSettings", tools: ((_b = (_a = findSelectedNode(editor, "image")) === null || _a === void 0 ? void 0 : _a.attrs) === null || _b === void 0 ? void 0 : _b.float)? ["imageAlignLeft", "imageAlignRight", "imageProperties"]: ["imageAlignLeft",diff --git a/packages/editor/src/toolbar/tools/image.tsx b/packages/editor/src/toolbar/tools/image.tsxindex abc4ca4e4..e5c084330 100644--- a/packages/editor/src/toolbar/tools/image.tsx+++ b/packages/editor/src/toolbar/tools/image.tsx@@ -15,11 +15,8 @@ import { findSelectedNode } from "../utils/prosemirror";export function ImageSettings(props: ToolProps) {const { editor } = props;const isBottom = useToolbarLocation() === "bottom";- if (!editor.isActive("image") || !isBottom) return null;- const image = useMemo(() => findSelectedNode(editor, "image"), []);- const { float } = (image?.attrs || {}) as ImageAlignmentOptions &- ImageSizeOptions;+ if (!editor.isActive("image") || !isBottom) return null;return (<MoreTools@@ -27,7 +24,7 @@ export function ImageSettings(props: ToolProps) {autoCloseOnUnmountpopupId="imageSettings"tools={- float+ findSelectedNode(editor, "image")?.attrs?.float? ["imageAlignLeft", "imageAlignRight", "imageProperties"]: ["imageAlignLeft",