fix(polls): Fix 'Skip' button functionality

This commit is contained in:
Vlad Piersec
2021-10-12 14:04:16 +03:00
committed by vp8x8
parent 09efaa0d0d
commit 70af0d6b78
12 changed files with 105 additions and 35 deletions

View File

@@ -13,9 +13,11 @@ const PollAnswer = (props: AbstractProps) => {
poll,
setCheckbox,
skipAnswer,
skipChangeVote,
submitAnswer,
t
} = props;
const { changingVote } = poll;
return (
<div className = 'poll-answer'>
@@ -45,7 +47,7 @@ const PollAnswer = (props: AbstractProps) => {
<button
aria-label = { t('polls.answer.skip') }
className = 'poll-button poll-button-secondary poll-button-shortest'
onClick = { skipAnswer } >
onClick = { changingVote ? skipChangeVote : skipAnswer } >
<span>{t('polls.answer.skip')}</span>
</button>
<button

View File

@@ -17,7 +17,7 @@ type Props = {
}
const PollItem = React.forwardRef<Props, HTMLElement>(({ pollId }, ref) => {
const showResults = useSelector(state => shouldShowResults(state, pollId));
const showResults = useSelector(shouldShowResults(pollId));
return (
<div ref = { ref }>