chore: optimize unreact network requests (#5747)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: boojack <stevenlgtm@gmail.com>
This commit is contained in:
parent
a7cabb7ce6
commit
23a7e99a21
1 changed files with 1 additions and 3 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue