mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-22 12:27:11 +02:00
Prevent voting when poll is locked
This commit is contained in:
parent
46efb0fa48
commit
5f653ff593
1 changed files with 2 additions and 2 deletions
|
@ -72,7 +72,7 @@ const Poll: React.VoidFunctionComponent<PollProps> = ({ pollId }) => {
|
|||
const [didUsePagination, setDidUsePagination] = React.useState(false);
|
||||
|
||||
const [shouldShowNewParticipantForm, setShouldShowNewParticipantForm] =
|
||||
React.useState(!userAlreadyVoted);
|
||||
React.useState(!userAlreadyVoted && !poll.closed);
|
||||
|
||||
const pollWidth =
|
||||
sidebarWidth + options.length * columnWidth + actionColumnWidth;
|
||||
|
@ -198,7 +198,7 @@ const Poll: React.VoidFunctionComponent<PollProps> = ({ pollId }) => {
|
|||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
{shouldShowNewParticipantForm ? (
|
||||
{shouldShowNewParticipantForm && !poll.closed ? (
|
||||
<ParticipantRowForm
|
||||
className="border-t bg-slate-100 bg-opacity-0"
|
||||
onSubmit={(data) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue