Unverified Commit 23a7e99a authored by google-labs-jules[bot]'s avatar google-labs-jules[bot] Committed by GitHub

chore: optimize unreact network requests (#5747)

Co-authored-by: 's avatargoogle-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: 's avatarboojack <stevenlgtm@gmail.com>
parent a7cabb7c
...@@ -48,9 +48,7 @@ export const useReactionActions = ({ memo, onComplete }: UseReactionActionsOptio ...@@ -48,9 +48,7 @@ export const useReactionActions = ({ memo, onComplete }: UseReactionActionsOptio
const reactions = memo.reactions.filter( const reactions = memo.reactions.filter(
(reaction) => reaction.reactionType === reactionType && reaction.creator === currentUser.name, (reaction) => reaction.reactionType === reactionType && reaction.creator === currentUser.name,
); );
for (const reaction of reactions) { await Promise.all(reactions.map((reaction) => memoServiceClient.deleteMemoReaction({ name: reaction.name })));
await memoServiceClient.deleteMemoReaction({ name: reaction.name });
}
} else { } else {
await memoServiceClient.upsertMemoReaction({ await memoServiceClient.upsertMemoReaction({
name: memo.name, name: memo.name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment