Skip to content
Snippets Groups Projects
Commit ccc7fe3e authored by ThibG's avatar ThibG Committed by Eugen Rochko
Browse files

When sending a toot, ensure a CW is only set if the CW field is visible (#11206)

In some occasions, such as the browser or a browser extension auto-filling
the existing but disabled/hidden CW field, a CW can be set without the user
knowing.
parent 84ff3938
No related branches found
No related tags found
No related merge requests found
......@@ -139,7 +139,7 @@ export function submitCompose(routerHistory) {
in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null),
media_ids: media.map(item => item.get('id')),
sensitive: getState().getIn(['compose', 'sensitive']),
spoiler_text: getState().getIn(['compose', 'spoiler_text'], ''),
spoiler_text: getState().getIn(['compose', 'spoiler']) ? getState().getIn(['compose', 'spoiler_text'], '') : '',
visibility: getState().getIn(['compose', 'privacy']),
poll: getState().getIn(['compose', 'poll'], null),
}, {
......
......@@ -224,6 +224,7 @@ export default function compose(state = initialState, action) {
}
});
case COMPOSE_SPOILER_TEXT_CHANGE:
if (!state.get('spoiler')) return state;
return state
.set('spoiler_text', action.text)
.set('idempotencyKey', uuid());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment