From 9fff4fb6269b4fdefb3971cbf15b9345a80dd204 Mon Sep 17 00:00:00 2001 From: silberengel Date: Sat, 23 Aug 2025 21:39:26 +0200 Subject: [PATCH] fixed npub display in notifications and eventdetails --- src/lib/components/EventDetails.svelte | 2 +- src/lib/components/Notifications.svelte | 10 +++++----- src/lib/snippets/UserSnippets.svelte | 9 ++++++--- src/lib/utils/markup/basicMarkupParser.ts | 5 +++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/lib/components/EventDetails.svelte b/src/lib/components/EventDetails.svelte index cdbe669..2979b0d 100644 --- a/src/lib/components/EventDetails.svelte +++ b/src/lib/components/EventDetails.svelte @@ -288,7 +288,7 @@ import type { UserProfile } from "$lib/models/user_profile"; parsedContent = event.content; } else { // For all other events (including quote reposts), parse the content using basic markup parser - parseBasicmarkup(event.content).then((processed) => { + parseBasicmarkup(event.content, getNdkContext()).then((processed) => { parsedContent = processed; }).catch((error) => { console.error("Error parsing content:", error); diff --git a/src/lib/components/Notifications.svelte b/src/lib/components/Notifications.svelte index d627de9..3466450 100644 --- a/src/lib/components/Notifications.svelte +++ b/src/lib/components/Notifications.svelte @@ -841,7 +841,7 @@
Comment:
- {#await parseBasicmarkup(message.content) then parsed} + {#await parseBasicmarkup(message.content, ndk) then parsed} {@html parsed} {/await} @@ -849,7 +849,7 @@ {:else} - {#await parseBasicmarkup(message.content || "No content") then parsed} + {#await parseBasicmarkup(message.content || "No content", ndk) then parsed} {@html parsed} {/await} {/if} @@ -951,7 +951,7 @@
Comment:
- {#await parseBasicmarkup(notification.content) then parsed} + {#await parseBasicmarkup(notification.content, ndk) then parsed} {@html parsed} {/await} @@ -959,7 +959,7 @@ {:else} - {#await parseBasicmarkup(notification.content || "No content") then parsed} + {#await parseBasicmarkup(notification.content || "No content", ndk) then parsed} {@html parsed} {/await} {/if} @@ -999,7 +999,7 @@
Replying to:
- {#await parseBasicmarkup(replyToMessage.content || "No content") then parsed} + {#await parseBasicmarkup(replyToMessage.content || "No content", ndk) then parsed} {@html parsed} {/await}
diff --git a/src/lib/snippets/UserSnippets.svelte b/src/lib/snippets/UserSnippets.svelte index 54c9cf0..497a650 100644 --- a/src/lib/snippets/UserSnippets.svelte +++ b/src/lib/snippets/UserSnippets.svelte @@ -6,6 +6,7 @@ getUserMetadata, } from "$lib/utils/nostrUtils"; import type { UserProfile } from "$lib/models/user_profile"; + import { getNdkContext } from "$lib/ndk"; export { userBadge }; @@ -14,8 +15,9 @@ {@const npub = toNpub(identifier)} {#if npub} {#if !displayText || displayText.trim().toLowerCase() === "unknown"} - {#await getUserMetadata(npub, undefined, false) then profile} + {#await getUserMetadata(npub, getNdkContext(), false) then profile} {@const p = profile as UserProfile} + {@const debugInfo = console.log("Profile data for", npub, ":", p)}