Browse Source

修改投票选项数上限

closed-social-v3
欧醚 2 years ago
parent
commit
910de600d5
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      app/javascript/mastodon/features/compose/components/poll_form.js
  2. +1
    -1
      app/validators/poll_validator.rb

+ 1
- 1
app/javascript/mastodon/features/compose/components/poll_form.js View File

@ -157,7 +157,7 @@ class PollForm extends ImmutablePureComponent {
</ul>
<div className='poll__footer'>
<button disabled={options.size >= 4} className='button button-secondary' onClick={this.handleAddOption}><Icon id='plus' /> <FormattedMessage {...messages.add_option} /></button>
<button disabled={options.size >= 10} 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}>

+ 1
- 1
app/validators/poll_validator.rb View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
class PollValidator < ActiveModel::Validator
MAX_OPTIONS = 4
MAX_OPTIONS = 10
MAX_OPTION_CHARS = 50
MAX_EXPIRATION = 1.month.freeze
MIN_EXPIRATION = 5.minutes.freeze

Loading…
Cancel
Save