Unfollow tool for Bluesky

limit batch to 200

Changed files
+7 -4
src
+7 -4
src/App.tsx
···
};
});
if (agent.session) {
-
await agent.com.atproto.repo.applyWrites({
-
repo: agent.session.did,
-
writes: writes,
-
});
}
setNotices([`Unfollowed ${unfollowCount} accounts.`]);
···
};
});
+
const BATCHSIZE = 200;
if (agent.session) {
+
for (let i = 0; i < writes.length; i += BATCHSIZE) {
+
await agent.com.atproto.repo.applyWrites({
+
repo: agent.session.did,
+
writes: writes.slice(i, i + BATCHSIZE),
+
});
+
}
}
setNotices([`Unfollowed ${unfollowCount} accounts.`]);