From 07fb465e697d74f25cce4a21c3b44619c85e262f Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 19 Jan 2026 21:02:11 +0000 Subject: [PATCH] fix: resolve variable naming conflicts and unused variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix remaining TypeScript compilation errors: 1. Remove unused 'nostrUri' from addNodeView destructuring - Not needed since we have all individual pieces (eventId, identifier, etc.) 2. Fix variable naming conflict in paste handler - Rename 'identifier' (nip19 encoded string) to 'nip19String' - Prevents shadowing with 'identifier' (naddr d tag value) - Fixes TS6133, TS2448, TS2454 errors Changes: - Line 321: Remove nostrUri from node.attrs destructuring - Line 399: Rename identifier → nip19String - Line 402: Use nip19String in decode() - Line 445: Use nip19String in nostr: URI construction All variable scoping and naming conflicts now resolved. --- src/components/editor/MentionEditor.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/editor/MentionEditor.tsx b/src/components/editor/MentionEditor.tsx index 0fe6edd..804699b 100644 --- a/src/components/editor/MentionEditor.tsx +++ b/src/components/editor/MentionEditor.tsx @@ -318,8 +318,7 @@ const EventMentionNode = Node.create({ addNodeView() { return ({ node }) => { - const { decodedType, kind, nostrUri, eventId, pubkey, identifier } = - node.attrs; + const { decodedType, kind, eventId, pubkey, identifier } = node.attrs; // Create wrapper span const dom = document.createElement("span"); @@ -397,10 +396,10 @@ const EventMentionNode = Node.create({ const matchedText = matches[0]; // Strip "nostr:" prefix if present for decoding - const identifier = matchedText.replace(/^nostr:/i, ""); + const nip19String = matchedText.replace(/^nostr:/i, ""); try { - const decoded = nip19.decode(identifier); + const decoded = nip19.decode(nip19String); // Handle profile identifiers (npub/nprofile) - convert to @ mention if (decoded.type === "npub") { @@ -443,7 +442,7 @@ const EventMentionNode = Node.create({ // Always store with "nostr:" prefix for consistency const nostrUri = matchedText.startsWith("nostr:") ? matchedText - : `nostr:${identifier}`; + : `nostr:${nip19String}`; let decodedType: string; let eventId: string | null = null;