mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at ruby-v 24 lines 724 B view raw
1import {useQuery} from '@tanstack/react-query' 2 3import {resolveShortLink} from '#/lib/link-meta/resolve-short-link' 4import {parseStarterPackUri} from '#/lib/strings/starter-pack' 5import {STALE} from '#/state/queries/index' 6 7const ROOT_URI = 'https://go.bsky.app/' 8 9const RQKEY_ROOT = 'resolved-short-link' 10export const RQKEY = (code: string) => [RQKEY_ROOT, code] 11 12export function useResolvedStarterPackShortLink({code}: {code: string}) { 13 return useQuery({ 14 queryKey: RQKEY(code), 15 queryFn: async () => { 16 const uri = `${ROOT_URI}${code}` 17 const res = await resolveShortLink(uri) 18 return parseStarterPackUri(res) 19 }, 20 retry: 1, 21 enabled: Boolean(code), 22 staleTime: STALE.HOURS.ONE, 23 }) 24}