From 64af217dd79cce867b706cc2bb5135679650b95c Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 23 Jan 2024 03:25:00 +0300 Subject: [PATCH] enable-after-fail --- src/components/Article/ShoutRatingControl.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/Article/ShoutRatingControl.tsx b/src/components/Article/ShoutRatingControl.tsx index 31dc974c..8b24d08c 100644 --- a/src/components/Article/ShoutRatingControl.tsx +++ b/src/components/Article/ShoutRatingControl.tsx @@ -54,10 +54,14 @@ export const ShoutRatingControl = (props: ShoutRatingControlProps) => { const handleRatingChange = async (isUpvote: boolean) => { setIsLoading(true) requireAuthentication(async () => { - await createReaction({ - kind: isUpvote ? ReactionKind.Like : ReactionKind.Dislike, - shout: props.shout.id, - }) + try { + await createReaction({ + kind: isUpvote ? ReactionKind.Like : ReactionKind.Dislike, + shout: props.shout.id, + }) + } catch (error) { + console.warn(error) + } setIsLoading(false) loadShout(props.shout.slug) loadReactionsBy({