]> cat aescling's git repositories - mastodon.git/commitdiff
Do not mark toots as sensitive if they don't have any media attached
authorThibaut Girka <thib@sitedethib.com>
Fri, 1 Feb 2019 11:45:53 +0000 (12:45 +0100)
committerThibG <thib@sitedethib.com>
Fri, 1 Feb 2019 14:55:28 +0000 (15:55 +0100)
app/javascript/flavours/glitch/actions/compose.js

index 71d3fb1b238944236ccc0c5f4b10ae4fe277f94a..04e8577132161785a5bb6971edb26ab53478ce98 100644 (file)
@@ -134,7 +134,7 @@ export function submitCompose(routerHistory) {
       status,
       in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null),
       media_ids: media.map(item => item.get('id')),
-      sensitive: getState().getIn(['compose', 'sensitive']) || spoilerText.length > 0,
+      sensitive: getState().getIn(['compose', 'sensitive']) || (spoilerText.length > 0 && media.size !== 0),
       spoiler_text: spoilerText,
       visibility: getState().getIn(['compose', 'privacy']),
     }, {