diff options
author | Minseo Lee <itoupluk427@gmail.com> | 2024-03-19 10:52:29 +0900 |
---|---|---|
committer | Minseo Lee <itoupluk427@gmail.com> | 2024-03-19 10:52:29 +0900 |
commit | ad43d594c9f63fc85e6927d23cd3f3f21406b002 (patch) | |
tree | 8a20f9f9051ff066bd54c5bc126ccc548e2cb16c /src/state/queries/profile-extra-info.ts | |
parent | 73dae9f7b5c169aa303e9ef9487040e850998edf (diff) | |
parent | 3abf302b0b189c50acf11489bf60bdaeb187b722 (diff) | |
download | voidsky-ad43d594c9f63fc85e6927d23cd3f3f21406b002.tar.zst |
Merge remote-tracking branch 'upstream/main' into patch-3
Diffstat (limited to 'src/state/queries/profile-extra-info.ts')
-rw-r--r-- | src/state/queries/profile-extra-info.ts | 34 |
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, - } - }, - }) -} |