Skip to content

Commit

Permalink
Limit the number of answers to 8
Browse files Browse the repository at this point in the history
(As limited by the contract)
  • Loading branch information
csillag committed Oct 9, 2024
1 parent d726d83 commit 9fcedaa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/pages/CreatePollPage/useCreatePollForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export const useCreatePollForm = () => {
initialItemCount: 3, // Let's start with 3 answers.
placeholderTemplate: index => `Answer ${index + 1}`,
minItems: [2, minCount => `You need at least ${minCount} answers in order to create this poll.`],
maxItem: [10, maxCount => `Please don't offer more than ${maxCount} answers.`],
// Note: the contract only supports 8 options, so we have to keep the UI in sync with that.
maxItem: [8, maxCount => `Please don't offer more than ${maxCount} answers.`],
allowDuplicates: [false, ['This answer is repeated below.', 'The same answer was already listed above!']],
dropEmptyItems: true,
minItemLength: [1, minLength => `Please use at least ${minLength} characters for this answer.`],
Expand Down

0 comments on commit 9fcedaa

Please sign in to comment.