about summary refs log tree commit diff
path: root/app/javascript/mastodon/actions/compose.js
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-06-29 18:32:36 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-06-29 18:32:36 +0200
commitccc7fe3e1d04c7cabad916e4e57c7739743d5c91 (patch)
tree3aea15cf75ff0792dd3a01b8d32bfae8cc3a8996 /app/javascript/mastodon/actions/compose.js
parent84ff3938426da348e31651dfad376d83a9784343 (diff)
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.
Diffstat (limited to 'app/javascript/mastodon/actions/compose.js')
-rw-r--r--app/javascript/mastodon/actions/compose.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/javascript/mastodon/actions/compose.js b/app/javascript/mastodon/actions/compose.js
index 300fb48a9..fbf97d374 100644
--- a/app/javascript/mastodon/actions/compose.js
+++ b/app/javascript/mastodon/actions/compose.js
@@ -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),
     }, {