[SDK] Migrate getAllListMembers to the appview client (#11377)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-08-13 22:26:19 +03:00
committed by GitHub
parent f6a22c4f05
commit 3568cdc42d
5 changed files with 30 additions and 26 deletions
@@ -26,7 +26,7 @@ import {useSetHasCheckedForStarterPack} from '#/state/preferences/used-starter-p
import {getAllListMembers} from '#/state/queries/list-members'
import {preferencesQueryKey} from '#/state/queries/preferences'
import {RQKEY as profileRQKey} from '#/state/queries/profile'
import {useAgent} from '#/state/session'
import {useAgent, useAppviewClient} from '#/state/session'
import {useOnboardingDispatch} from '#/state/shell'
import {
useActiveStarterPack,
@@ -58,6 +58,7 @@ export function StepFinished() {
const [saving, setSaving] = useState(false)
const queryClient = useQueryClient()
const agent = useAgent()
const appviewClient = useAppviewClient()
const requestNotificationsPermission = useRequestNotificationsPermission()
const activeStarterPack = useActiveStarterPack()
const setActiveStarterPack = useSetActiveStarterPack()
@@ -82,7 +83,10 @@ export function StepFinished() {
}
try {
if (starterPack?.list) {
listItems = await getAllListMembers(agent, starterPack.list.uri)
listItems = await getAllListMembers(
appviewClient,
starterPack.list.uri,
)
}
} catch (e) {
logger.error('Failed to fetch starter pack list items', {
@@ -231,6 +235,7 @@ export function StepFinished() {
ax,
queryClient,
agent,
appviewClient,
dispatch,
onboardDispatch,
activeStarterPack,
@@ -11,7 +11,7 @@ import {isBlockedOrBlocking, isMuted} from '#/lib/moderation/blocked-and-muted'
import {logger} from '#/logger'
import {updateProfileShadow} from '#/state/cache/profile-shadow'
import {getAllListMembers} from '#/state/queries/list-members'
import {useAgent, useSession} from '#/state/session'
import {useAgent, useAppviewClient, useSession} from '#/state/session'
import {bulkWriteFollows} from '#/screens/Onboarding/util'
import {AvatarStack} from '#/screens/Search/components/StarterPackCard'
import {atoms as a, useBreakpoints, useTheme, web} from '#/alf'
@@ -36,6 +36,7 @@ export function StarterPackCard({
const {currentAccount} = useSession()
const {gtPhone} = useBreakpoints()
const agent = useAgent()
const appviewClient = useAppviewClient()
const queryClient = useQueryClient()
const record = view.record
const [isProcessing, setIsProcessing] = useState(false)
@@ -48,7 +49,7 @@ export function StarterPackCard({
let listItems: AppBskyGraphDefs.ListItemView[] = []
try {
listItems = await getAllListMembers(agent, view.list.uri)
listItems = await getAllListMembers(appviewClient, view.list.uri)
} catch (e) {
setIsProcessing(false)
Toast.show(_(msg`An error occurred while trying to follow all`), {
@@ -37,7 +37,7 @@ import {
useDeleteStarterPackMutation,
useStarterPackQuery,
} from '#/state/queries/starter-packs'
import {useAgent, useSession} from '#/state/session'
import {useAgent, useAppviewClient, useSession} from '#/state/session'
import {useSetActiveStarterPack} from '#/state/shell/landing'
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
import {
@@ -312,6 +312,7 @@ function Header({
const t = useTheme()
const {currentAccount, hasSession} = useSession()
const agent = useAgent()
const appviewClient = useAppviewClient()
const queryClient = useQueryClient()
const setActiveStarterPack = useSetActiveStarterPack()
const {requestSwitchToAccount} = useLoggedOutViewControls()
@@ -354,7 +355,7 @@ function Header({
let listItems: AppBskyGraphDefs.ListItemView[] = []
try {
listItems = await getAllListMembers(agent, starterPack.list.uri)
listItems = await getAllListMembers(appviewClient, starterPack.list.uri)
} catch (e) {
setIsProcessing(false)
Toast.show(_(msg`An error occurred while trying to follow all`), {