···
-
import { createSignal, onMount, For, Show, type Component } from "solid-js";
import { createStore } from "solid-js/store";
···
const [followRecords, setFollowRecords] = createStore<FollowRecord[]>([]);
const [loginState, setLoginState] = createSignal(false);
const resolveDid = async (did: string) => {
···
status_label: status_label,
visible: status == RepoStatus.NONMUTUAL ? false : true,
setProgress(progress() + 1);
const unfollow = async () => {
const writes = followRecords
-
.filter((record) => record.toBeDeleted)
$type: "com.atproto.repo.applyWrites#delete",
···
···
const Follows: Component = () => {
field: keyof FollowRecord,
-
followRecords.forEach((record, index) => {
-
if (record.status & status) setFollowRecords(index, field, value);
const options: { status: RepoStatus; label: string }[] = [
···
···
<div class="sm:min-w-96">
<For each={followRecords}>
···
-
checked={record.toBeDeleted}
-
<div classList={{ "bg-red-300": record.toBeDeleted }}>
<label for={"record" + index()} class="flex flex-col">
<span>@{record.handle}</span>
<span>{record.did}</span>
···
<Show when={loginState()}>
-
<Show when={followRecords.length}>
···
import { createStore } from "solid-js/store";
···
const [followRecords, setFollowRecords] = createStore<FollowRecord[]>([]);
const [loginState, setLoginState] = createSignal(false);
+
const [fetchState, setFetchState] = createSignal(false);
const resolveDid = async (did: string) => {
···
status_label: status_label,
visible: status == RepoStatus.NONMUTUAL ? false : true,
setProgress(progress() + 1);
+
if (progress() == followCount()) setFetchState(true);
const unfollow = async () => {
const writes = followRecords
+
.filter((record) => record.toDelete)
$type: "com.atproto.repo.applyWrites#delete",
···
···
const Follows: Component = () => {
+
const [selectedCount, setSelectedCount] = createSignal(0);
+
setSelectedCount(followRecords.filter((record) => record.toDelete).length);
field: keyof FollowRecord,
+
const range = followRecords.map((record, index) => {
+
if (record.status & status) return index;
+
range.filter((i) => i !== undefined),
const options: { status: RepoStatus; label: string }[] = [
···
···
+
<div class="min-w-36 pt-3 sm:pt-0">
+
Selected: {selectedCount()}/{followRecords.length}
<div class="sm:min-w-96">
<For each={followRecords}>
···
+
checked={record.toDelete}
+
<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()}>
+
<Show when={fetchState()}>