Skip to content

Commit

Permalink
sonarqube fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shrushti2000 committed Dec 20, 2024
1 parent fe200e6 commit 1407f38
Showing 1 changed file with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,27 @@ function FeedCardFooter({

applyPatch(patch);
};
const handleAnnouncementReaction = async (
reaction: ReactionType,
operation: ReactionOperation
) => {
updateAnnouncementsThreadReactions(post, reaction, operation);
};

const handleDefaultReaction = async (
reaction: ReactionType,
operation: ReactionOperation
) => {
await updateReactions(post, feed.id, !isPost, reaction, operation);
await fetchUpdatedThread(feed.id);
};

const onReactionUpdate = useCallback(
async (reaction: ReactionType, operation: ReactionOperation) => {
if (isAnnouncementTab) {
updateAnnouncementsThreadReactions(post, reaction, operation);
await handleAnnouncementReaction(reaction, operation);
} else {
await updateReactions(post, feed.id, !isPost, reaction, operation);
await fetchUpdatedThread(feed.id);
await handleDefaultReaction(reaction, operation);
}
},
[updateReactions, post, feed.id, isPost, fetchUpdatedThread]
Expand Down

0 comments on commit 1407f38

Please sign in to comment.