Skip to content

Commit

Permalink
Don't validate poll completion date when not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
csillag committed Sep 20, 2024
1 parent 1f083cd commit 0e286a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/pages/CreatePollPage/useCreatePollForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ export const useCreatePollForm = () => {
const deadline = value.getTime() / 1000
const remaining = DateUtils.calculateRemainingTimeFrom(deadline, now)
const { isPastDue, totalSeconds } = remaining
if (isPastDue || totalSeconds < MIN_COMPLETION_TIME_MINUTES * 60) {
if (hasCompletionDate.value && (isPastDue || totalSeconds < MIN_COMPLETION_TIME_MINUTES * 60)) {
return `Please set a time at least ${MIN_COMPLETION_TIME_MINUTES} minutes in the future!`
}
},
Expand Down

0 comments on commit 0e286a7

Please sign in to comment.