myrate-update-fix
This commit is contained in:
parent
bbb5ad435a
commit
6bee204280
|
@ -87,7 +87,8 @@ export const RatingControl = (props: RatingControlProps) => {
|
||||||
const fakeId = Date.now() + Math.floor(Math.random() * 1000)
|
const fakeId = Date.now() + Math.floor(Math.random() * 1000)
|
||||||
// const savedRatings = [...props.ratings]
|
// const savedRatings = [...props.ratings]
|
||||||
mergeProps(props.ratings, [...props.ratings, { ...rateInput, id: fakeId, created_by: author() }])
|
mergeProps(props.ratings, [...props.ratings, { ...rateInput, id: fakeId, created_by: author() }])
|
||||||
await createReaction(rateInput)
|
const newReaction = await createReaction(rateInput)
|
||||||
|
setMyRate(newReaction) // Добавляем созданный голос в myRate
|
||||||
console.debug(`[RatingControl.handleRatingChange] your ${voteKind} vote was created`)
|
console.debug(`[RatingControl.handleRatingChange] your ${voteKind} vote was created`)
|
||||||
} else {
|
} else {
|
||||||
console.debug('[RatingControl.handleRatingChange] already has your vote', myRate())
|
console.debug('[RatingControl.handleRatingChange] already has your vote', myRate())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user