1
0

Restore glitch-soc's support of custom poll limits

This commit is contained in:
Claire 2024-02-22 23:01:58 +01:00
parent 9c10aaa4d5
commit 5fd50756b4
2 changed files with 4 additions and 3 deletions

View File

@ -15,6 +15,7 @@ import {
selectComposeSuggestion,
} from 'flavours/glitch/actions/compose';
import AutosuggestInput from 'flavours/glitch/components/autosuggest_input';
import { pollLimits } from 'flavours/glitch/initial_state';
const messages = defineMessages({
option_placeholder: { id: 'compose_form.poll.option_placeholder', defaultMessage: 'Option {number}' },
@ -83,7 +84,7 @@ const Option = ({ multipleChoice, index, title, autoFocus }) => {
<AutosuggestInput
placeholder={intl.formatMessage(messages.option_placeholder, { number: index + 1 })}
maxLength={100}
maxLength={pollLimits.max_option_chars}
value={title}
lang={lang}
spellCheck

View File

@ -55,7 +55,7 @@ import {
import { REDRAFT } from '../actions/statuses';
import { STORE_HYDRATE } from '../actions/store';
import { TIMELINE_DELETE } from '../actions/timelines';
import { me, defaultContentType } from '../initial_state';
import { me, defaultContentType, pollLimits } from '../initial_state';
import { recoverHashtags } from '../utils/hashtag';
import { unescapeHTML } from '../utils/html';
import { overwrite } from '../utils/js_helpers';
@ -369,7 +369,7 @@ const updatePoll = (state, index, value) => state.updateIn(['poll', 'options'],
if (tmp.size === 0) {
return tmp.push('').push('');
} else if (tmp.size < 4) {
} else if (tmp.size < pollLimits.max_options) {
return tmp.push('');
}