From cc04e13be4c342f497f233c14ea1ae86c2d8da8e Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 23 Jan 2024 17:43:26 +0300 Subject: [PATCH] upvote-disabling --- src/components/Article/ShoutRatingControl.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/Article/ShoutRatingControl.tsx b/src/components/Article/ShoutRatingControl.tsx index c65d02e4..7fcb2c19 100644 --- a/src/components/Article/ShoutRatingControl.tsx +++ b/src/components/Article/ShoutRatingControl.tsx @@ -62,6 +62,7 @@ export const ShoutRatingControl = (props: ShoutRatingControlProps) => { const handleRatingChange = async (isUpvote: boolean) => { requireAuthentication(async () => { + setIsLoading(true) if (isUpvoted()) { await deleteShoutReaction(ReactionKind.Like) } else if (isDownvoted()) { @@ -77,6 +78,8 @@ export const ShoutRatingControl = (props: ShoutRatingControlProps) => { loadReactionsBy({ by: { shout: props.shout.slug }, }) + + setIsLoading(false) }, 'vote') }