diff options
author | Kuwa Lee <kuwalee1069@gmail.com> | 2024-06-16 20:04:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-16 20:04:56 +0800 |
commit | fa1dfe8b0a7c405d608eea72c20dfeef22d36715 (patch) | |
tree | 4bd21370fafe33e2ee093546a7377bfd71c82978 /src/components/ProfileHoverCard/index.web.tsx | |
parent | 01f505d09f35b642c5ea9206f10e1ff68f4eb0d5 (diff) | |
parent | 10c6035f310ba1a3a0420a4e013e2b2b30ddb374 (diff) | |
download | voidsky-fa1dfe8b0a7c405d608eea72c20dfeef22d36715.tar.zst |
Merge branch 'bluesky-social:main' into zh
Diffstat (limited to 'src/components/ProfileHoverCard/index.web.tsx')
-rw-r--r-- | src/components/ProfileHoverCard/index.web.tsx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/components/ProfileHoverCard/index.web.tsx b/src/components/ProfileHoverCard/index.web.tsx index e17977af4..4f110485e 100644 --- a/src/components/ProfileHoverCard/index.web.tsx +++ b/src/components/ProfileHoverCard/index.web.tsx @@ -51,10 +51,23 @@ const floatingMiddlewares = [ ] export function ProfileHoverCard(props: ProfileHoverCardProps) { + const prefetchProfileQuery = usePrefetchProfileQuery() + const prefetchedProfile = React.useRef(false) + const onPointerMove = () => { + if (!prefetchedProfile.current) { + prefetchedProfile.current = true + prefetchProfileQuery(props.did) + } + } + if (props.disable || isTouchDevice) { return props.children } else { - return <ProfileHoverCardInner {...props} /> + return ( + <View onPointerMove={onPointerMove}> + <ProfileHoverCardInner {...props} /> + </View> + ) } } |