about summary refs log tree commit diff
path: root/src/components
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-06-16 02:23:48 -0700
committerGitHub <noreply@github.com>2024-06-16 12:23:48 +0300
commitd0bb97e8a9e9ae5e36c85dcb292616e60558a921 (patch)
tree67cddd8e0b940786ef77160870da93a72aff2dc4 /src/components
parenteaef1446f2236cc4c8993e4c57d5bcc5bb2263d9 (diff)
downloadvoidsky-d0bb97e8a9e9ae5e36c85dcb292616e60558a921.tar.zst
fix native post meta (#4530)
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ProfileHoverCard/index.web.tsx15
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>
+    )
   }
 }