about summary refs log tree commit diff
path: root/src/state/queries/profile-extra-info.ts
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-03-19 15:18:29 +0000
committerSamuel Newman <mozzius@protonmail.com>2024-03-19 15:18:29 +0000
commitf491bd89cc28cba46a92b443e1f07ff73e8f7128 (patch)
tree8f7c34372afe1f600a5626ef72dd9c8b28b930a6 /src/state/queries/profile-extra-info.ts
parentd2a11f3344149a299372f0a7dcd01de9f58ef9a1 (diff)
parent9c49b209ca9eda8e6fab0942f7046d335c955c1a (diff)
downloadvoidsky-f491bd89cc28cba46a92b443e1f07ff73e8f7128.tar.zst
Merge remote-tracking branch 'origin/main' into samuel/alf-login
Diffstat (limited to 'src/state/queries/profile-extra-info.ts')
-rw-r--r--src/state/queries/profile-extra-info.ts34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/state/queries/profile-extra-info.ts b/src/state/queries/profile-extra-info.ts
deleted file mode 100644
index 8fc32c33e..000000000
--- a/src/state/queries/profile-extra-info.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import {useQuery} from '@tanstack/react-query'
-
-import {getAgent} from '#/state/session'
-import {STALE} from '#/state/queries'
-
-// TODO refactor invalidate on mutate?
-export const RQKEY = (did: string) => ['profile-extra-info', did]
-
-/**
- * Fetches some additional information for the profile screen which
- * is not available in the API's ProfileView
- */
-export function useProfileExtraInfoQuery(did: string) {
-  return useQuery({
-    staleTime: STALE.MINUTES.ONE,
-    queryKey: RQKEY(did),
-    async queryFn() {
-      const [listsRes, feedsRes] = await Promise.all([
-        getAgent().app.bsky.graph.getLists({
-          actor: did,
-          limit: 1,
-        }),
-        getAgent().app.bsky.feed.getActorFeeds({
-          actor: did,
-          limit: 1,
-        }),
-      ])
-      return {
-        hasLists: listsRes.data.lists.length > 0,
-        hasFeedgens: feedsRes.data.feeds.length > 0,
-      }
-    },
-  })
-}