Fix Edit as well as “Delete & Redraft” on a poll not inserting empty option (#35892)
This commit is contained in:
parent
b71216a08a
commit
a48567784c
3 changed files with 32 additions and 12 deletions
|
|
@ -501,8 +501,13 @@ export const composeReducer = (state = initialState, action) => {
|
|||
}
|
||||
|
||||
if (action.status.get('poll')) {
|
||||
let options = ImmutableList(action.status.get('poll').options.map(x => x.title));
|
||||
if (options.size < action.maxOptions) {
|
||||
options = options.push('');
|
||||
}
|
||||
|
||||
map.set('poll', ImmutableMap({
|
||||
options: ImmutableList(action.status.get('poll').options.map(x => x.title)),
|
||||
options: options,
|
||||
multiple: action.status.get('poll').multiple,
|
||||
expires_in: expiresInFromExpiresAt(action.status.get('poll').expires_at),
|
||||
}));
|
||||
|
|
@ -530,8 +535,13 @@ export const composeReducer = (state = initialState, action) => {
|
|||
}
|
||||
|
||||
if (action.status.get('poll')) {
|
||||
let options = ImmutableList(action.status.get('poll').options.map(x => x.title));
|
||||
if (options.size < action.maxOptions) {
|
||||
options = options.push('');
|
||||
}
|
||||
|
||||
map.set('poll', ImmutableMap({
|
||||
options: ImmutableList(action.status.get('poll').options.map(x => x.title)),
|
||||
options: options,
|
||||
multiple: action.status.get('poll').multiple,
|
||||
expires_in: expiresInFromExpiresAt(action.status.get('poll').expires_at),
|
||||
}));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue