From d462c4e36b50e019853416f89e3540c590188f8d Mon Sep 17 00:00:00 2001 From: mr0x50 <24775431+mroxso@users.noreply.github.com> Date: Sun, 2 Feb 2025 21:47:20 +0100 Subject: [PATCH] fix avatar dropdown will not close when clicking on a dropdown item --- .../headerComponents/AvatarDropdown.tsx | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/lumina/components/headerComponents/AvatarDropdown.tsx b/lumina/components/headerComponents/AvatarDropdown.tsx index 55af16c..c75ae49 100644 --- a/lumina/components/headerComponents/AvatarDropdown.tsx +++ b/lumina/components/headerComponents/AvatarDropdown.tsx @@ -17,44 +17,37 @@ import Link from "next/link" import { nip19 } from "nostr-tools" export function AvatarDropdown() { - let pubkey = window.localStorage.getItem('pubkey'); let pubkeyEncoded = pubkey ? nip19.npubEncode(pubkey) : pubkey; - let src = "https://robohash.org/" + (pubkey as string); - const { data: userData } = useProfile({ pubkey: pubkey as string, }); - if (pubkey !== null) { src = userData?.picture || "https://robohash.org/" + pubkey; } - return ( - {/* */} - + Profile - - + + Settings - { window.localStorage.clear(); window.location.href = "/" }}> + { + window.localStorage.clear(); + window.location.href = "/"; + }}> Logout