···
106
-
if (followRecords.length == 0) {
107
-
await fetchFollows(agent).then((follows) =>
108
-
follows.forEach((record: any) => {
109
-
setFollowRecords(followRecords.length, {
110
-
did: record.value.subject,
113
-
status: RepoStatus.ACTIVE,
114
-
toBeDeleted: false,
105
+
await fetchFollows(agent).then((follows) =>
106
+
follows.forEach((record: any) => {
107
+
setFollowRecords(followRecords.length, {
108
+
did: record.value.subject,
111
+
status: RepoStatus.ACTIVE,
112
+
toBeDeleted: false,
120
-
setFollowCount(followRecords.length);
118
+
setFollowCount(followRecords.length);
122
-
followRecords.forEach(async (record, index) => {
124
-
const res = await agent.getProfile({ actor: record.did });
125
-
if (res.data.viewer?.blockedBy) {
126
-
setFollowRecords(index, "handle", res.data.handle);
127
-
setFollowRecords(index, "status", RepoStatus.BLOCKEDBY);
130
-
const res = await fetch(
131
-
record.did.startsWith("did:web")
132
-
? "https://" + record.did.split(":")[2] + "/.well-known/did.json"
133
-
: "https://plc.directory/" + record.did,
120
+
followRecords.forEach(async (record, index) => {
122
+
const res = await agent.getProfile({ actor: record.did });
123
+
if (res.data.viewer?.blockedBy) {
124
+
setFollowRecords(index, "handle", res.data.handle);
125
+
setFollowRecords(index, "status", RepoStatus.BLOCKEDBY);
128
+
const res = await fetch(
129
+
record.did.startsWith("did:web")
130
+
? "https://" + record.did.split(":")[2] + "/.well-known/did.json"
131
+
: "https://plc.directory/" + record.did,
139
-
await res.json().then((doc) => {
140
-
for (const alias of doc.alsoKnownAs) {
141
-
if (alias.includes("at://")) {
142
-
return alias.split("//")[1];
137
+
await res.json().then((doc) => {
138
+
for (const alias of doc.alsoKnownAs) {
139
+
if (alias.includes("at://")) {
140
+
return alias.split("//")[1];
148
-
if (e.message.includes("not found")) {
149
-
setFollowRecords(index, "status", RepoStatus.DELETED);
150
-
} else if (e.message.includes("deactivated")) {
151
-
setFollowRecords(index, "status", RepoStatus.DEACTIVATED);
152
-
} else if (e.message.includes("suspended")) {
153
-
setFollowRecords(index, "status", RepoStatus.SUSPENDED);
146
+
if (e.message.includes("not found")) {
147
+
setFollowRecords(index, "status", RepoStatus.DELETED);
148
+
} else if (e.message.includes("deactivated")) {
149
+
setFollowRecords(index, "status", RepoStatus.DEACTIVATED);
150
+
} else if (e.message.includes("suspended")) {
151
+
setFollowRecords(index, "status", RepoStatus.SUSPENDED);
156
-
setProgress(progress() + 1);
154
+
setProgress(progress() + 1);