···
: "https://plc.directory/" + did,
+
return res.json().then((doc) => {
for (const alias of doc.alsoKnownAs) {
if (alias.includes("at://")) {
return alias.split("//")[1];
···
agent = new Agent(result.session);
+
setHandle(await resolveDid(agent.assertDid));
sub = result.session.sub;
···
const fetchPage = async (cursor?: string) => {
return await agent.com.atproto.repo.listRecords({
collection: "app.bsky.graph.follow",
···
+
const follows = await fetchFollows();
+
setFollowCount(follows.length);
+
let tmpFollows: FollowRecord[] = [];
+
follows.forEach(async (record: ComAtprotoRepoListRecords.Record) => {
+
let status: RepoStatus | undefined = undefined;
+
const follow = record.value as AppBskyGraphFollow.Record;
+
const res = await agent.getProfile({
+
handle = res.data.handle;
+
const viewer = res.data.viewer!;
+
if (!viewer.followedBy) status = RepoStatus.NONMUTUAL;
+
if (viewer.blockedBy) {
+
viewer.blocking || viewer.blockingByList ?
+
RepoStatus.BLOCKEDBY | RepoStatus.BLOCKING
+
: RepoStatus.BLOCKEDBY;
+
} else if (res.data.did.includes(agent.assertDid)) {
+
status = RepoStatus.YOURSELF;
+
} else if (viewer.blocking || viewer.blockingByList) {
+
status = RepoStatus.BLOCKING;
+
handle = await resolveDid(follow.subject);
+
e.message.includes("not found") ? RepoStatus.DELETED
+
: e.message.includes("deactivated") ? RepoStatus.DEACTIVATED
+
: e.message.includes("suspended") ? RepoStatus.SUSPENDED
+
status == RepoStatus.DELETED ? "Deleted"
+
: status == RepoStatus.DEACTIVATED ? "Deactivated"
+
: status == RepoStatus.SUSPENDED ? "Suspended"
+
: status == RepoStatus.NONMUTUAL ? "Non Mutual"
+
: status == RepoStatus.YOURSELF ? "Literally Yourself"
+
: status == RepoStatus.BLOCKING ? "Blocking"
+
: status == RepoStatus.BLOCKEDBY ? "Blocked by"
+
: RepoStatus.BLOCKEDBY | RepoStatus.BLOCKING ? "Mutual Block"
+
if (status !== undefined) {
+
status_label: status_label,
+
visible: status == RepoStatus.NONMUTUAL ? false : true,
+
setProgress(progress() + 1);
+
if (progress() == followCount()) setFollowRecords(tmpFollows);
···
for (let i = 0; i < writes.length; i += BATCHSIZE) {
await agent.com.atproto.repo.applyWrites({
writes: writes.slice(i, i + BATCHSIZE),