route appview state and facet resolution off the pds client
Audit of usePdsClient call sites: the PDS client is for com.atproto.* account/repo operations. Appview-private state (actor/list/thread mutes, notification seen-state) and mention/facet resolution now use the appview-routed client. useRichText also regains logged-out mention resolution via useLexClient's public fallback (usePdsClient throws when logged out, silently leaving mentions unresolved on StarterPackLanding and web ProfileHoverCard). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -474,10 +474,10 @@ export function useProfileMuteMutationQueue(
|
||||
|
||||
function useProfileMuteMutation() {
|
||||
const queryClient = useQueryClient()
|
||||
const pdsClient = usePdsClient()
|
||||
const appviewClient = useAppviewClient()
|
||||
return useMutation<void, Error, {did: string}>({
|
||||
mutationFn: async ({did}) => {
|
||||
await pdsClient.call(muteActor, {actor: did as AtIdentifierString})
|
||||
await appviewClient.call(muteActor, {actor: did as AtIdentifierString})
|
||||
},
|
||||
onSuccess() {
|
||||
void queryClient.invalidateQueries({queryKey: RQKEY_MY_MUTED()})
|
||||
@@ -487,10 +487,10 @@ function useProfileMuteMutation() {
|
||||
|
||||
function useProfileUnmuteMutation() {
|
||||
const queryClient = useQueryClient()
|
||||
const pdsClient = usePdsClient()
|
||||
const appviewClient = useAppviewClient()
|
||||
return useMutation<void, Error, {did: string}>({
|
||||
mutationFn: async ({did}) => {
|
||||
await pdsClient.call(unmuteActor, {actor: did as AtIdentifierString})
|
||||
await appviewClient.call(unmuteActor, {actor: did as AtIdentifierString})
|
||||
},
|
||||
onSuccess() {
|
||||
void queryClient.invalidateQueries({queryKey: RQKEY_MY_MUTED()})
|
||||
|
||||
Reference in New Issue
Block a user