···
1
+
import { createSignal, For, Show, type Component } from "solid-js";
import { createStore } from "solid-js/store";
import { Agent } from "@atproto/api";
···
22
+
status_label: string;
···
<label for={"record" + index()} class="flex flex-col">
<span>@{record.handle}</span>
<span>{record.did}</span>
171
-
(RepoStatus.BLOCKEDBY | RepoStatus.BLOCKING)
176
-
<Match when={record.status == RepoStatus.DELETED}>
179
-
<Match when={record.status == RepoStatus.DEACTIVATED}>
182
-
<Match when={record.status == RepoStatus.BLOCKEDBY}>
185
-
<Match when={record.status == RepoStatus.BLOCKING}>
188
-
<Match when={record.status == RepoStatus.SUSPENDED}>
191
-
<Match when={record.status == RepoStatus.YOURSELF}>
194
-
<Match when={record.status == RepoStatus.NONMUTUAL}>
160
+
<span>{record.status_label}</span>
···
241
-
await fetchFollows().then((follows) =>
203
+
await fetchFollows().then((follows) => {
204
+
setFollowCount(follows.length);
follows.forEach(async (record: any) => {
243
-
setFollowCount(follows.length);
206
+
let status: RepoStatus | undefined = undefined;
const res = await agent.getProfile({
actor: record.value.subject,
214
+
handle = res.data.handle;
const viewer = res.data.viewer!;
251
-
let status: RepoStatus | undefined = undefined;
if (!viewer.followedBy) status = RepoStatus.NONMUTUAL;
···
} else if (viewer.blocking || viewer.blockingByList) {
status = RepoStatus.BLOCKING;
266
-
if (status !== undefined) {
267
-
setFollowRecords(followRecords.length, {
268
-
did: record.value.subject,
269
-
handle: res.data.handle,
272
-
toBeDeleted: false,
record.value.subject.startsWith("did:web")
···
: "https://plc.directory/" + record.value.subject,
285
-
const status = e.message.includes("not found")
238
+
status = e.message.includes("not found")
: e.message.includes("deactivated")
···
293
-
const handle = await res.json().then((doc) => {
246
+
handle = await res.json().then((doc) => {
for (const alias of doc.alsoKnownAs) {
if (alias.includes("at://")) {
return alias.split("//")[1];
301
-
if (status !== undefined) {
302
-
setFollowRecords(followRecords.length, {
303
-
did: record.value.subject,
307
-
toBeDeleted: false,
255
+
const status_label =
256
+
status == RepoStatus.DELETED
258
+
: status == RepoStatus.DEACTIVATED
260
+
: status == RepoStatus.SUSPENDED
262
+
: status == RepoStatus.NONMUTUAL
264
+
: status == RepoStatus.YOURSELF
265
+
? "Literally Yourself"
266
+
: status == RepoStatus.BLOCKING
268
+
: status == RepoStatus.BLOCKEDBY
270
+
: RepoStatus.BLOCKEDBY | RepoStatus.BLOCKING
274
+
if (status !== undefined) {
275
+
setFollowRecords(followRecords.length, {
276
+
did: record.value.subject,
280
+
status_label: status_label,
281
+
toBeDeleted: false,
setProgress(progress() + 1);
const unfollow = async () => {