about summary refs log tree commit diff
path: root/src/state/queries/postgate/index.ts
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-06-19 19:25:17 +0300
committerGitHub <noreply@github.com>2025-06-19 09:25:17 -0700
commitd53fdb0dda528f0f70ed34f580c8bf64ec6b1d39 (patch)
treee4c72467ef344930cdc16c0c31d3f312b1d19e74 /src/state/queries/postgate/index.ts
parent9be3b0794c9ed6cd4e80651c03175f79566ba065 (diff)
downloadvoidsky-d53fdb0dda528f0f70ed34f580c8bf64ec6b1d39.tar.zst
fix prefetch returning undefined (#8538)
Diffstat (limited to 'src/state/queries/postgate/index.ts')
-rw-r--r--src/state/queries/postgate/index.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/state/queries/postgate/index.ts b/src/state/queries/postgate/index.ts
index 346e7bfe2..8c86dc017 100644
--- a/src/state/queries/postgate/index.ts
+++ b/src/state/queries/postgate/index.ts
@@ -2,10 +2,10 @@ import React from 'react'
 import {
   AppBskyEmbedRecord,
   AppBskyEmbedRecordWithMedia,
-  AppBskyFeedDefs,
+  type AppBskyFeedDefs,
   AppBskyFeedPostgate,
   AtUri,
-  BskyAgent,
+  type BskyAgent,
 } from '@atproto/api'
 import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query'
 
@@ -139,7 +139,7 @@ export function usePostgateQuery({postUri}: {postUri: string}) {
     staleTime: STALE.SECONDS.THIRTY,
     queryKey: createPostgateQueryKey(postUri),
     async queryFn() {
-      return (await getPostgateRecord({agent, postUri})) ?? null
+      return await getPostgateRecord({agent, postUri}).then(res => res ?? null)
     },
   })
 }