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...
)}