Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

Prevent voting when poll is locked

Luke Vella5f653ff5938b
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<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) => {