enable-after-fail

This commit is contained in:
Untone 2024-01-23 03:25:00 +03:00
parent e4332128c8
commit 64af217dd7

View File

@ -54,10 +54,14 @@ export const ShoutRatingControl = (props: ShoutRatingControlProps) => {
const handleRatingChange = async (isUpvote: boolean) => { const handleRatingChange = async (isUpvote: boolean) => {
setIsLoading(true) setIsLoading(true)
requireAuthentication(async () => { requireAuthentication(async () => {
try {
await createReaction({ await createReaction({
kind: isUpvote ? ReactionKind.Like : ReactionKind.Dislike, kind: isUpvote ? ReactionKind.Like : ReactionKind.Dislike,
shout: props.shout.id, shout: props.shout.id,
}) })
} catch (error) {
console.warn(error)
}
setIsLoading(false) setIsLoading(false)
loadShout(props.shout.slug) loadShout(props.shout.slug)
loadReactionsBy({ loadReactionsBy({