Vanilla flavor: Reduce amount of data stored in initial state for min_options on polls

This commit is contained in:
Jeremy Kescher 2022-11-02 21:16:10 +01:00
parent 3d2fc73ecb
commit c3bffb95b6
No known key found for this signature in database
GPG key ID: 48DFE4BB15BA5940
3 changed files with 3 additions and 3 deletions

View file

@ -103,7 +103,7 @@ class Option extends React.PureComponent {
</label>
<div className='poll__cancel'>
<IconButton disabled={index < pollLimits.min_options} title={intl.formatMessage(messages.remove_option)} icon='times' onClick={this.handleOptionRemove} />
<IconButton disabled={index < pollMinOptions} title={intl.formatMessage(messages.remove_option)} icon='times' onClick={this.handleOptionRemove} />
</div>
</li>
);

View file

@ -133,6 +133,6 @@ export const languages = initialState?.languages;
export const maxChars = (initialState && initialState.max_toot_chars) || 500;
// CatCatNya~ specific settings
export const pollLimits = (initialState && initialState.poll_limits);
export const pollMinOptions = (initialState && initialState.poll_limits && initialState.poll_limits.min_options) || 2;
export default initialState;

View file

@ -95,7 +95,7 @@ const initialState = ImmutableMap({
});
const initialPoll = ImmutableMap({
options: ImmutableList(new Array(pollLimits.min_options).fill('')),
options: ImmutableList(new Array(pollMinOptions).fill('')),
expires_in: 24 * 3600,
multiple: false,
});