mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-14 16:28:59 +00:00
[Glitch] Fix Edit as well as “Delete & Redraft” on a poll not inserting empty option
Port d8c07be021 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -644,8 +644,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),
|
||||
}));
|
||||
@@ -678,8 +683,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),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user