mirror of https://github.com/usememos/memos.git
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
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue