[SDK] Migrate agent sugar to @bsky.app/sdk actions (#11382)

This commit is contained in:
Samuel Newman
2026-08-13 22:26:21 +03:00
committed by GitHub
parent a4f2811f39
commit dc31e7fd12
24 changed files with 520 additions and 389 deletions
@@ -16,7 +16,7 @@ import {Trans} from '@lingui/react/macro'
import {retry} from '#/lib/async/retry'
import {wait} from '#/lib/async/wait'
import {parseLinkingUrl} from '#/lib/parseLinkingUrl'
import {useAgent, useSession} from '#/state/session'
import {useAppviewClient, useSession} from '#/state/session'
import {atoms as a, platform, useBreakpoints, useTheme} from '#/alf'
import {AgeAssuranceBadge} from '#/components/ageAssurance/AgeAssuranceBadge'
import {Button, ButtonText} from '#/components/Button'
@@ -176,7 +176,7 @@ function Inner() {
const t = useTheme()
const ax = useAnalytics()
const {_} = useLingui()
const agent = useAgent()
const appviewClient = useAppviewClient()
const polling = useRef(false)
const unmounted = useRef(false)
const [error, setError] = useState(false)
@@ -196,10 +196,10 @@ function Inner() {
5,
() => true,
async () => {
if (!agent.session) return
if (!appviewClient.did) return
if (unmounted.current) return
const data = await refetchAgeAssuranceServerState({agent})
const data = await refetchAgeAssuranceServerState({appviewClient})
if (data?.state.status !== 'assured') {
throw new Error(
@@ -214,7 +214,7 @@ function Inner() {
)
.then(async data => {
if (!data) return
if (!agent.session) return
if (!appviewClient.did) return
if (unmounted.current) return
setSuccess(true)
@@ -230,7 +230,7 @@ function Inner() {
return () => {
unmounted.current = true
}
}, [ax, agent])
}, [ax, appviewClient])
if (success) {
return (