diff --git a/src/lib/components/CommentBox.svelte b/src/lib/components/CommentBox.svelte
index fbff0f3..6952279 100644
--- a/src/lib/components/CommentBox.svelte
+++ b/src/lib/components/CommentBox.svelte
@@ -10,6 +10,7 @@
} from "$lib/utils/search_utility";
import { userPubkey } from "$lib/stores/authStore.Svelte";
+ import { userStore } from "$lib/stores/userStore";
import type { NDKEvent } from "$lib/utils/nostrUtils";
import {
extractRootEventInfo,
@@ -67,17 +68,12 @@
}
});
+ // Get user profile from userStore
$effect(() => {
- const trimmedPubkey = $userPubkey?.trim();
- const npub = toNpub(trimmedPubkey);
- if (npub) {
- // Call an async function, but don't make the effect itself async
- getUserMetadata(npub).then((metadata) => {
- userProfile = metadata;
- });
- } else if (trimmedPubkey) {
- userProfile = null;
- error = "Invalid public key: must be a 64-character hex string.";
+ const currentUser = $userStore;
+ if (currentUser?.signedIn && currentUser.profile) {
+ userProfile = currentUser.profile;
+ error = null;
} else {
userProfile = null;
error = null;
@@ -590,17 +586,20 @@
{
- const img = e.target as HTMLImageElement;
- img.src = `https://api.dicebear.com/7.x/avataaars/svg?seed=${encodeURIComponent(img.alt)}`;
- }}
+ class="w-8 h-8 rounded-full object-cover"
+ onerror={(e) => (e.target as HTMLImageElement).style.display = 'none'}
/>
+ {:else}
+
Loading comments...
+{error}
+No comments or highlights yet. Be the first to engage!
+Error loading {notificationMode === "public-messages" ? "public messages" : "notifications"}: {error}
+No public messages found.
+No notifications {notificationMode === "to-me" ? "received" : "sent"} found.
++ No recipients selected. Click "Edit Recipients" to add recipients. +
+