From 53d70a98bf9b6ceafbd962b6911cd50601dbe16c Mon Sep 17 00:00:00 2001 From: Curtis Date: Thu, 2 Jul 2020 18:32:42 +0000 Subject: [PATCH] Update compose.js to decouple spoiler from marking media as NSFW --- app/soapbox/reducers/compose.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/soapbox/reducers/compose.js b/app/soapbox/reducers/compose.js index d9d554d47..c2e39e866 100644 --- a/app/soapbox/reducers/compose.js +++ b/app/soapbox/reducers/compose.js @@ -114,7 +114,7 @@ function appendMedia(state, media) { map.set('resetFileKey', Math.floor((Math.random() * 0x10000))); map.set('idempotencyKey', uuid()); - if (prevSize === 0 && (state.get('default_sensitive') || state.get('spoiler'))) { + if (prevSize === 0 && state.get('default_sensitive')) { map.set('sensitive', true); } }); @@ -211,9 +211,7 @@ export default function compose(state = initialState, action) { .set('is_composing', false); case COMPOSE_SENSITIVITY_CHANGE: return state.withMutations(map => { - if (!state.get('spoiler')) { - map.set('sensitive', !state.get('sensitive')); - } + map.set('sensitive', !state.get('sensitive')); map.set('idempotencyKey', uuid()); }); @@ -222,10 +220,6 @@ export default function compose(state = initialState, action) { map.set('spoiler_text', ''); map.set('spoiler', !state.get('spoiler')); map.set('idempotencyKey', uuid()); - - if (!state.get('sensitive') && state.get('media_attachments').size >= 1) { - map.set('sensitive', true); - } }); case COMPOSE_SPOILER_TEXT_CHANGE: return state