Skip to content

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

editor: don't show open & copy tools for empty links Signed-off-by: 01zulfi <[email protected]>

01zulfiaaf82f359b4d
diff --git a/packages/editor/src/toolbar/tools/link.tsx b/packages/editor/src/toolbar/tools/link.tsx
index f14f9fb11..8afa5a616 100644
--- a/packages/editor/src/toolbar/tools/link.tsx
+++ b/packages/editor/src/toolbar/tools/link.tsx
@@ -196,6 +196,7 @@ export function OpenLink(props: ToolProps) {
const link = node ? findMark(node, "link") : null;
if (!link) return null;
const href = link?.attrs.href;
+ if (!href) return null;
return (
<Flex sx={{ alignItems: "center" }}>
@@ -245,6 +246,7 @@ export function CopyLink(props: ToolProps) {
const link = node ? findMark(node, "link") : null;
if (!link) return null;
const href = link?.attrs.href;
+ if (!href) return null;
return (
<ToolButton