diff options
Diffstat (limited to 'src/components')
-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> + ) } } |