Fix repost state drift and document workflow

This commit is contained in:
cyph3rasi
2026-03-07 19:47:49 -08:00
parent 76ca21e14f
commit 17baf8e4f0
12 changed files with 256 additions and 23 deletions
+7 -4
View File
@@ -173,10 +173,13 @@ export default function Home() {
const handleRepost = async (postId: string, currentReposted: boolean) => {
if (!did || !handle) return;
if (currentReposted) {
await signedAPI.unrepostPost(postId, did, handle);
} else {
await signedAPI.repostPost(postId, did, handle);
const res = currentReposted
? await signedAPI.unrepostPost(postId, did, handle)
: await signedAPI.repostPost(postId, did, handle);
if (!res.ok) {
const data = await res.json().catch(() => ({}));
throw new Error(data.error || 'Failed to update repost');
}
};