···
1
-
import { createSignal, onMount, For, Show, type Component } from "solid-js";
import { createStore } from "solid-js/store";
···
28
-
toBeDeleted: boolean;
const [followRecords, setFollowRecords] = createStore<FollowRecord[]>([]);
const [loginState, setLoginState] = createSignal(false);
41
+
const [fetchState, setFetchState] = createSignal(false);
const resolveDid = async (did: string) => {
···
status_label: status_label,
221
-
toBeDeleted: false,
visible: status == RepoStatus.NONMUTUAL ? false : true,
setProgress(progress() + 1);
234
+
if (progress() == followCount()) setFetchState(true);
const unfollow = async () => {
const writes = followRecords
232
-
.filter((record) => record.toBeDeleted)
241
+
.filter((record) => record.toDelete)
$type: "com.atproto.repo.applyWrites#delete",
···
259
+
setFetchState(false);
···
const Follows: Component = () => {
300
+
const [selectedCount, setSelectedCount] = createSignal(0);
302
+
createEffect(() => {
303
+
setSelectedCount(followRecords.filter((record) => record.toDelete).length);
field: keyof FollowRecord,
295
-
followRecords.forEach((record, index) => {
296
-
if (record.status & status) setFollowRecords(index, field, value);
311
+
const range = followRecords.map((record, index) => {
312
+
if (record.status & status) return index;
315
+
range.filter((i) => i !== undefined),
const options: { status: RepoStatus; label: string }[] = [
···
···
384
+
<div class="min-w-36 pt-3 sm:pt-0">
386
+
Selected: {selectedCount()}/{followRecords.length}
<div class="sm:min-w-96">
<For each={followRecords}>
···
374
-
checked={record.toBeDeleted}
400
+
checked={record.toDelete}
384
-
<div classList={{ "bg-red-300": record.toBeDeleted }}>
410
+
<div classList={{ "bg-red-300": record.toDelete }}>
<label for={"record" + index()} class="flex flex-col">
<span>@{record.handle}</span>
<span>{record.did}</span>
···
<Show when={loginState()}>
433
-
<Show when={followRecords.length}>
459
+
<Show when={fetchState()}>