ai/at
1
0

fix social-app web support link

This commit is contained in:
2026-02-16 05:36:31 +09:00
parent 0506a32fd8
commit 19299233fc
4 changed files with 39 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
--- a/src/screens/Profile/Header/ProfileHeaderStandard.tsx 2026-02-16 03:00:07 --- a/src/screens/Profile/Header/ProfileHeaderStandard.tsx
+++ b/src/screens/Profile/Header/ProfileHeaderStandard.tsx 2026-02-16 03:02:25 +++ b/src/screens/Profile/Header/ProfileHeaderStandard.tsx
@@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
import {memo, useMemo, useState} from 'react' import {memo, useMemo, useState} from 'react'
-import {View} from 'react-native' -import {View} from 'react-native'
@@ -7,28 +7,20 @@
import { import {
type AppBskyActorDefs, type AppBskyActorDefs,
moderateProfile, moderateProfile,
@@ -9,9 +9,11 @@ @@ -9,9 +9,12 @@
} from '@atproto/api' } from '@atproto/api'
import {msg, Trans} from '@lingui/macro' import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
+import {useQuery} from '@tanstack/react-query' +import {useQuery} from '@tanstack/react-query'
import {useActorStatus} from '#/lib/actor-status' import {useActorStatus} from '#/lib/actor-status'
+import {BSKY_SERVICE} from '#/lib/constants'
import {useHaptics} from '#/lib/haptics' import {useHaptics} from '#/lib/haptics'
+import {useOpenLink} from '#/lib/hooks/useOpenLink' +import {useOpenLink} from '#/lib/hooks/useOpenLink'
import {sanitizeDisplayName} from '#/lib/strings/display-names' import {sanitizeDisplayName} from '#/lib/strings/display-names'
import {sanitizeHandle} from '#/lib/strings/handles' import {sanitizeHandle} from '#/lib/strings/handles'
import {logger} from '#/logger' import {logger} from '#/logger'
@@ -20,7 +22,7 @@ @@ -45,6 +48,84 @@
useProfileBlockMutationQueue,
useProfileFollowMutationQueue,
} from '#/state/queries/profile'
-import {useRequireAuth, useSession} from '#/state/session'
+import {useAgent, useRequireAuth, useSession} from '#/state/session'
import {ProfileMenu} from '#/view/com/profile/ProfileMenu'
import {atoms as a, platform, useBreakpoints, useTheme} from '#/alf'
import {SubscribeProfileButton} from '#/components/activity-notifications/SubscribeProfileButton'
@@ -45,6 +47,83 @@
import {ProfileHeaderMetrics} from './Metrics' import {ProfileHeaderMetrics} from './Metrics'
import {ProfileHeaderShell} from './Shell' import {ProfileHeaderShell} from './Shell'
import {ProfileHeaderSuggestedFollows} from './SuggestedFollows' import {ProfileHeaderSuggestedFollows} from './SuggestedFollows'
@@ -45,16 +37,17 @@
+ profile: AppBskyActorDefs.ProfileViewDetailed + profile: AppBskyActorDefs.ProfileViewDetailed
+}) { +}) {
+ const t = useTheme() + const t = useTheme()
+ const agent = useAgent()
+ const openLink = useOpenLink() + const openLink = useOpenLink()
+ +
+ const {data: services} = useQuery({ + const {data: services} = useQuery({
+ queryKey: ['profile-services', profile.did], + queryKey: ['profile-services', profile.did],
+ queryFn: async () => { + queryFn: async () => {
+ const res = await agent.com.atproto.repo.describeRepo({ + const res = await fetch(
+ repo: profile.did, + `${BSKY_SERVICE}/xrpc/com.atproto.repo.describeRepo?repo=${encodeURIComponent(profile.did)}`,
+ }) + )
+ const collections: string[] = res.data.collections || [] + if (!res.ok) throw new Error('failed')
+ const data = await res.json()
+ const collections: string[] = data.collections || []
+ const serviceSet = new Set<string>() + const serviceSet = new Set<string>()
+ for (const nsid of collections) { + for (const nsid of collections) {
+ const parts = nsid.split('.') + const parts = nsid.split('.')
@@ -112,7 +105,7 @@
interface Props { interface Props {
profile: AppBskyActorDefs.ProfileViewDetailed profile: AppBskyActorDefs.ProfileViewDetailed
@@ -151,6 +230,7 @@ @@ -151,6 +232,7 @@
{!isPlaceholderProfile && !isBlockedUser && ( {!isPlaceholderProfile && !isBlockedUser && (
<View style={a.gap_md}> <View style={a.gap_md}>
<ProfileHeaderMetrics profile={profile} /> <ProfileHeaderMetrics profile={profile} />

View File

@@ -0,0 +1,19 @@
--- a/src/view/shell/desktop/RightNav.tsx
+++ b/src/view/shell/desktop/RightNav.tsx
@@ -111,14 +111,14 @@
</>
)}
<InlineLinkText
- to="https://bsky.social/about/support/privacy-policy"
+ to="/support/privacy-policy"
style={[t.atoms.text_contrast_medium]}
label={_(msg`Privacy`)}>
{_(msg`Privacy`)}
</InlineLinkText>
<Text style={[t.atoms.text_contrast_low]}>{' ∙ '}</Text>
<InlineLinkText
- to="https://bsky.social/about/support/tos"
+ to="/support/tos"
style={[t.atoms.text_contrast_medium]}
label={_(msg`Terms`)}>
{_(msg`Terms`)}

View File

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

View File

@@ -50,6 +50,7 @@ PATCH_FILES_IOS=(
"040-social-app-ios-hide-composer-prompt.patch" "040-social-app-ios-hide-composer-prompt.patch"
"041-social-app-ios-splash-signin-button.patch" "041-social-app-ios-splash-signin-button.patch"
"042-social-app-ios-at-links.patch" "042-social-app-ios-at-links.patch"
"043-social-app-ios-rightnav-links.patch"
) )
function ios-env() { function ios-env() {