From 5f653ff5938b7184474fce1c76c0b0f72fe9c3e2 Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Thu, 12 May 2022 13:16:06 +0100 Subject: [PATCH] Prevent voting when poll is locked --- components/poll/desktop-poll.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/poll/desktop-poll.tsx b/components/poll/desktop-poll.tsx index 513d5044d..dfa6bae9f 100644 --- a/components/poll/desktop-poll.tsx +++ b/components/poll/desktop-poll.tsx @@ -72,7 +72,7 @@ const Poll: React.VoidFunctionComponent = ({ 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 = ({ pollId }) => { ) : null} - {shouldShowNewParticipantForm ? ( + {shouldShowNewParticipantForm && !poll.closed ? ( {