From 28b6e4ba14f31aaabdb69abac53cf2f8a43f7c49 Mon Sep 17 00:00:00 2001 From: Apoorv Mishra Date: Tue, 18 Nov 2025 16:38:42 +0530 Subject: [PATCH] cleanup: hasLink not needed --- shared/editor/components/Image.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shared/editor/components/Image.tsx b/shared/editor/components/Image.tsx index 8a8a74c1e0..1834de6710 100644 --- a/shared/editor/components/Image.tsx +++ b/shared/editor/components/Image.tsx @@ -10,7 +10,6 @@ import { ComponentProps } from "../types"; import { ResizeLeft, ResizeRight } from "./ResizeHandle"; import useDragResize from "./hooks/useDragResize"; import { useTranslation } from "react-i18next"; -import some from "lodash/some"; import find from "lodash/find"; type Props = ComponentProps & { @@ -71,7 +70,6 @@ const Image = (props: Props) => { }, [node.attrs.width]); const sanitizedSrc = sanitizeUrl(src); - const hasLink = some(node.attrs.marks ?? [], (mark) => mark.type === "link"); const imgLink = find(node.attrs.marks ?? [], (mark) => mark.type === "link")?.attrs.href ?? ""; @@ -121,7 +119,7 @@ const Image = (props: Props) => { )} - {hasLink && !props.isEditable && ( + {imgLink && !props.isEditable && (