Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore: optimize unreact network requests (#5747)

google-labs-jules[bot]23a7e99a21e3
diff --git a/web/src/components/MemoReactionListView/hooks.ts b/web/src/components/MemoReactionListView/hooks.ts
index c6a3a32db..b98c51205 100644
--- a/web/src/components/MemoReactionListView/hooks.ts
+++ b/web/src/components/MemoReactionListView/hooks.ts
@@ -48,9 +48,7 @@ export const useReactionActions = ({ memo, onComplete }: UseReactionActionsOptio
const reactions = memo.reactions.filter(
(reaction) => reaction.reactionType === reactionType && reaction.creator === currentUser.name,
);
- for (const reaction of reactions) {
- await memoServiceClient.deleteMemoReaction({ name: reaction.name });
- }
+ await Promise.all(reactions.map((reaction) => memoServiceClient.deleteMemoReaction({ name: reaction.name })));
} else {
await memoServiceClient.upsertMemoReaction({
name: memo.name,