0
0
Fork 0

Disable sensitive button when with content warnings (#4460)

This commit is contained in:
Yamagishi Kazutoshi 2017-07-31 12:06:56 +09:00 committed by Eugen Rochko
parent e1fcad34a9
commit bb85043f46
3 changed files with 19 additions and 8 deletions

View file

@ -152,9 +152,13 @@ export default function compose(state = initialState, action) {
.set('mounted', false)
.set('is_composing', false);
case COMPOSE_SENSITIVITY_CHANGE:
return state
.set('sensitive', !state.get('sensitive'))
.set('idempotencyKey', uuid());
return state.withMutations(map => {
if (!state.get('spoiler')) {
map.set('sensitive', !state.get('sensitive'));
}
map.set('idempotencyKey', uuid());
});
case COMPOSE_SPOILERNESS_CHANGE:
return state.withMutations(map => {
map.set('spoiler_text', '');