1
0
Fork 0
forked from gitea/nas

Merge remote-tracking branch 'parent/main' into upstream-20240308

This commit is contained in:
KMY 2024-03-12 09:27:01 +09:00
commit 8e94ed2cec
204 changed files with 5112 additions and 1998 deletions

View file

@ -363,12 +363,12 @@ const updateSuggestionTags = (state, token) => {
});
};
const updatePoll = (state, index, value) => state.updateIn(['poll', 'options'], options => {
const updatePoll = (state, index, value, maxOptions) => state.updateIn(['poll', 'options'], options => {
const tmp = options.set(index, value).filterNot(x => x.trim().length === 0);
if (tmp.size === 0) {
return tmp.push('').push('');
} else if (tmp.size < 8) {
} else if (tmp.size < maxOptions) {
return tmp.push('');
}
@ -646,7 +646,7 @@ export default function compose(state = initialState, action) {
case COMPOSE_POLL_REMOVE:
return state.set('poll', null);
case COMPOSE_POLL_OPTION_CHANGE:
return updatePoll(state, action.index, action.title);
return updatePoll(state, action.index, action.title, action.maxOptions);
case COMPOSE_POLL_SETTINGS_CHANGE:
return state.update('poll', poll => poll.set('expires_in', action.expiresIn).set('multiple', action.isMultiple));
case COMPOSE_CIRCLE_CHANGE: