use xrpc dispatcher
This commit is contained in:
@@ -37,14 +37,14 @@ export function usePreferencesQuery() {
|
||||
refetchOnWindowFocus: true,
|
||||
queryKey: preferencesQueryKey,
|
||||
queryFn: async () => {
|
||||
if (agent.session?.did === undefined) {
|
||||
if (!agent.did) {
|
||||
return DEFAULT_LOGGED_OUT_PREFERENCES
|
||||
} else {
|
||||
const res = await agent.getPreferences()
|
||||
|
||||
// save to local storage to ensure there are labels on initial requests
|
||||
saveLabelers(
|
||||
agent.session.did,
|
||||
agent.did,
|
||||
res.moderationPrefs.labelers.map(l => l.did),
|
||||
)
|
||||
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<<<<<<< HEAD
|
||||
import {AtpSessionData, AtpSessionEvent, BskyAgent} from '@atproto/api'
|
||||
import {TID} from '@atproto/common-web'
|
||||
=======
|
||||
import {
|
||||
AtpSessionData,
|
||||
AtpSessionEvent,
|
||||
BskyAgent,
|
||||
SessionDispatcher,
|
||||
} from '@atproto/api'
|
||||
>>>>>>> 1a535b0b7 (use xrpc dispatcher)
|
||||
|
||||
import {networkRetry} from '#/lib/async/retry'
|
||||
import {
|
||||
@@ -35,7 +44,7 @@ export async function createAgentAndResume(
|
||||
) {
|
||||
const agent = new BskyAgent({service: storedAccount.service})
|
||||
if (storedAccount.pdsUrl) {
|
||||
agent.pdsUrl = agent.api.xrpc.uri = new URL(storedAccount.pdsUrl)
|
||||
agent.sessionManager.pdsUrl = new URL(storedAccount.pdsUrl)
|
||||
}
|
||||
const gates = tryFetchGates(storedAccount.did, 'prefer-low-latency')
|
||||
const moderation = configureModerationForAccount(agent, storedAccount)
|
||||
|
||||
Reference in New Issue
Block a user