+13
-13
src/App.tsx
+13
-13
src/App.tsx
···
282
282
const follow = record.value as AppBskyGraphFollow.Main;
283
283
let handle = "";
284
284
285
-
try {
286
-
const res = await rpc.get("app.bsky.actor.getProfile", {
287
-
params: { actor: follow.subject },
288
-
});
285
+
const res = await rpc.get("app.bsky.actor.getProfile", {
286
+
params: { actor: follow.subject },
287
+
});
289
288
290
-
if (!res.ok) throw new Error(res.data.error);
289
+
if (!res.ok) {
290
+
handle = await resolveDid(follow.subject);
291
+
const e = res.data as any;
292
+
293
+
status =
294
+
e.message.includes("not found") ? RepoStatus.DELETED
295
+
: e.message.includes("deactivated") ? RepoStatus.DEACTIVATED
296
+
: e.message.includes("suspended") ? RepoStatus.SUSPENDED
297
+
: undefined;
298
+
} else {
291
299
handle = res.data.handle;
292
300
const viewer = res.data.viewer!;
293
301
···
303
311
} else if (viewer.blocking || viewer.blockingByList) {
304
312
status = RepoStatus.BLOCKING;
305
313
}
306
-
} catch (e: any) {
307
-
handle = await resolveDid(follow.subject);
308
-
309
-
status =
310
-
e.message.includes("not found") ? RepoStatus.DELETED
311
-
: e.message.includes("deactivated") ? RepoStatus.DEACTIVATED
312
-
: e.message.includes("suspended") ? RepoStatus.SUSPENDED
313
-
: undefined;
314
314
}
315
315
316
316
const status_label =