logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 970297a13887ff253ce2d65822ccd77a4e56c82e
parent: 29abc9438c35f81e862813d40d730b6164ea295a
Author: Yamagishi Kazutoshi <ykzts@desire.sh>
Date:   Sun, 30 Jul 2017 23:27:57 +0900

Change to sensitive when adding content warning from web UI (#4456)


Diffstat:

Mapp/javascript/mastodon/reducers/compose.js6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/javascript/mastodon/reducers/compose.js b/app/javascript/mastodon/reducers/compose.js @@ -88,7 +88,7 @@ function appendMedia(state, media) { map.set('focusDate', new Date()); map.set('idempotencyKey', uuid()); - if (prevSize === 0 && state.get('default_sensitive')) { + if (prevSize === 0 && (state.get('default_sensitive') || state.get('spoiler'))) { map.set('sensitive', true); } }); @@ -160,6 +160,10 @@ 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