From 895ddacaa9041f8f961fde3cac086759bd212ba7 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Mon, 25 May 2026 01:01:13 -0400 Subject: [PATCH] fix profile loading behavior --- components/ProfilePopover.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/ProfilePopover.tsx b/components/ProfilePopover.tsx index 925f8bfd..df7e3ab9 100644 --- a/components/ProfilePopover.tsx +++ b/components/ProfilePopover.tsx @@ -18,8 +18,9 @@ export const ProfilePopover = (props: { let [isHovered, setIsHovered] = useState(false); const hoverTimeout = useRef(null); + const shouldFetch = isHovered || isOpen; const { data, isLoading } = useSWR( - isHovered ? ["profile-data", props.didOrHandle] : null, + shouldFetch ? ["profile-data", props.didOrHandle] : null, async () => { const response = await callRPC("get_profile_data", { didOrHandle: props.didOrHandle, @@ -56,9 +57,7 @@ export const ProfilePopover = (props: { } onOpenChange={setIsOpen} > - {isLoading ? ( -
Loading...
- ) : data?.profile ? ( + {data?.profile ? (
+ ) : isLoading || !data ? ( +
Loading...
) : (
No profile found...
)} -- 2.51.2