From a52e1e2a17684c31a3ba1bba4d75849c928af4e1 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Mon, 3 Nov 2025 22:07:49 -0500 Subject: [PATCH] update --- js/nostr/commentEvents.js | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/js/nostr/commentEvents.js b/js/nostr/commentEvents.js index b2aecb29..cdca8d6e 100644 --- a/js/nostr/commentEvents.js +++ b/js/nostr/commentEvents.js @@ -118,6 +118,25 @@ function normalizePointerCandidate(candidate, expectedType) { }; } if ( + expectedType === "a" && + typeof candidate.address === "string" && + candidate.address.trim() + ) { + return { + value: candidate.address.trim(), + relay: normalizeRelay(candidate), + }; + } + if (candidate.tag) { + return normalizePointerCandidate(candidate.tag, expectedType); + } + if (candidate.pointer) { + return normalizePointerCandidate(candidate.pointer, expectedType); + } + } + + return null; +} function normalizeTagName(name) { return typeof name === "string" ? name.trim().toLowerCase() : ""; @@ -162,26 +181,6 @@ function normalizeDescriptorRelay(value) { } - expectedType === "a" && - typeof candidate.address === "string" && - candidate.address.trim() - ) { - return { - value: candidate.address.trim(), - relay: normalizeRelay(candidate), - }; - } - if (candidate.tag) { - return normalizePointerCandidate(candidate.tag, expectedType); - } - if (candidate.pointer) { - return normalizePointerCandidate(candidate.pointer, expectedType); - } - } - - return null; -} - function pickString(...candidates) { for (const candidate of candidates) { if (typeof candidate === "string" && candidate.trim()) {