fix social-app web support link
This commit is contained in:
@@ -3,8 +3,8 @@ import {Pressable, View} from 'react-native'
|
||||
import {type AppBskyActorDefs} from '@atproto/api'
|
||||
import {useQuery} from '@tanstack/react-query'
|
||||
|
||||
import {BSKY_SERVICE} from '#/lib/constants'
|
||||
import {useOpenLink} from '#/lib/hooks/useOpenLink'
|
||||
import {useAgent} from '#/state/session'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {createSinglePathSVG} from '#/components/icons/TEMPLATE'
|
||||
@@ -74,18 +74,17 @@ export function ProfileAtLinks({
|
||||
profile: AppBskyActorDefs.ProfileViewDetailed
|
||||
}) {
|
||||
const t = useTheme()
|
||||
const agent = useAgent()
|
||||
const openLink = useOpenLink()
|
||||
|
||||
const {data: linkData} = useQuery({
|
||||
queryKey: ['at-links', profile.did],
|
||||
queryFn: async () => {
|
||||
const res = await agent.com.atproto.repo.getRecord({
|
||||
repo: profile.did,
|
||||
collection: 'ai.syui.at.link',
|
||||
rkey: 'self',
|
||||
})
|
||||
return res.data.value as LinkCollection
|
||||
const res = await fetch(
|
||||
`${BSKY_SERVICE}/xrpc/com.atproto.repo.getRecord?repo=${encodeURIComponent(profile.did)}&collection=ai.syui.at.link&rkey=self`,
|
||||
)
|
||||
if (!res.ok) throw new Error('not found')
|
||||
const json = await res.json()
|
||||
return json.value as LinkCollection
|
||||
},
|
||||
retry: false,
|
||||
staleTime: 1000 * 60 * 5,
|
||||
|
||||
Reference in New Issue
Block a user