Skip to content

Commit

Permalink
Change to sensitive when adding content warning from web UI (#4456)
Browse files Browse the repository at this point in the history
  • Loading branch information
ykzts authored and Gargron committed Jul 30, 2017
1 parent 29abc94 commit 970297a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/javascript/mastodon/reducers/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 970297a

Please sign in to comment.