about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-07-26 17:30:16 +0000
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:45:20 -0500
commit44d6276b004feaa9e15fb2450d9ce4e98652e66c (patch)
tree0e84e6a24b8e72957da4119446635c5c9cb19498 /app
parentf81e156c10c5092dae246f1b3b96e0131ebf786c (diff)
bump poll sizes to 33 options x 202 chars
Diffstat (limited to 'app')
-rw-r--r--app/javascript/mastodon/features/compose/components/poll_form.js4
-rw-r--r--app/validators/poll_validator.rb8
2 files changed, 6 insertions, 6 deletions
diff --git a/app/javascript/mastodon/features/compose/components/poll_form.js b/app/javascript/mastodon/features/compose/components/poll_form.js
index 88894ae59..72ffeff09 100644
--- a/app/javascript/mastodon/features/compose/components/poll_form.js
+++ b/app/javascript/mastodon/features/compose/components/poll_form.js
@@ -89,7 +89,7 @@ class Option extends React.PureComponent {
 
           <AutosuggestInput
             placeholder={intl.formatMessage(messages.option_placeholder, { number: index + 1 })}
-            maxLength={100}
+            maxlength={202}
             value={title}
             onChange={this.handleOptionTitleChange}
             suggestions={this.props.suggestions}
@@ -157,7 +157,7 @@ class PollForm extends ImmutablePureComponent {
         </ul>
 
         <div className='poll__footer'>
-          <button disabled={options.size >= 5} className='button button-secondary' onClick={this.handleAddOption}><Icon id='plus' /> <FormattedMessage {...messages.add_option} /></button>
+          <button disabled={options.size >= 33} className='button button-secondary' onClick={this.handleAddOption}><Icon id='plus' /> <FormattedMessage {...messages.add_option} /></button>
 
           {/* eslint-disable-next-line jsx-a11y/no-onchange */}
           <select value={expiresIn} onChange={this.handleSelectDuration}>
diff --git a/app/validators/poll_validator.rb b/app/validators/poll_validator.rb
index 8259a62e5..898c0c67b 100644
--- a/app/validators/poll_validator.rb
+++ b/app/validators/poll_validator.rb
@@ -1,10 +1,10 @@
 # frozen_string_literal: true
 
 class PollValidator < ActiveModel::Validator
-  MAX_OPTIONS      = 5
-  MAX_OPTION_CHARS = 100
-  MAX_EXPIRATION   = 1.month.freeze
-  MIN_EXPIRATION   = 5.minutes.freeze
+  MAX_OPTIONS      = 33
+  MAX_OPTION_CHARS = 202
+  MAX_EXPIRATION   = 6.months.freeze
+  MIN_EXPIRATION   = 1.minute.freeze
 
   def validate(poll)
     current_time = Time.now.utc