···
} from "@atcute/oauth-browser-client";
14
-
import { $type, Did, Handle } from "@atcute/lexicons";
14
+
import { $type, ActorIdentifier, Did, Handle } from "@atcute/lexicons";
import { ComAtprotoRepoApplyWrites } from "@atcute/atproto";
import { AppBskyGraphFollow } from "@atcute/bluesky";
···
let agent: OAuthUserAgent;
let manager: CredentialManager;
50
+
let agentDID: string;
const resolveDid = async (did: string) => {
···
agent = new OAuthUserAgent(session);
rpc = new Client({ handler: agent });
116
+
agentDID = agent.sub;
setHandle(await resolveDid(agent.sub));
···
const loginBsky = async (login: string) => {
152
-
const agentDID = login.startsWith("did:") ? login : await resolveHandle(login);
154
+
agentDID = login.startsWith("did:") ? login : await resolveHandle(login);
manager = new CredentialManager({ service: await getPDS(agentDID) });
rpc = new Client({ handler: manager });
···
const fetchPage = async (cursor?: string) => {
return await rpc.get("com.atproto.repo.listRecords", {
250
+
repo: agentDID as ActorIdentifier,
collection: "app.bsky.graph.follow",
···
viewer.blocking || viewer.blockingByList ?
RepoStatus.BLOCKEDBY | RepoStatus.BLOCKING
309
-
} else if (res.data.did.includes(agent.sub)) {
311
+
} else if (res.data.did.includes(agentDID)) {
status = RepoStatus.YOURSELF;
} else if (viewer.blocking || viewer.blockingByList) {
status = RepoStatus.BLOCKING;
···
for (let i = 0; i < writes.length; i += BATCHSIZE) {
await rpc.post("com.atproto.repo.applyWrites", {
366
+
repo: agentDID as ActorIdentifier,
writes: writes.slice(i, i + BATCHSIZE),