When replying to status with content warning, prefill content warning

This commit is contained in:
Eugen Rochko 2017-03-25 19:30:56 +01:00
parent ad1af951fb
commit a9303e7062
3 changed files with 9 additions and 2 deletions

View file

@ -152,11 +152,18 @@ export default function compose(state = initialState, action) {
map.set('privacy', privacyPreference(action.status.get('visibility'), state.get('default_privacy')));
map.set('focusDate', new Date());
map.set('preselectDate', new Date());
if (action.status.get('spoiler_text').length > 0) {
map.set('spoiler', true);
map.set('spoiler_text', action.status.get('spoiler_text'));
}
});
case COMPOSE_REPLY_CANCEL:
return state.withMutations(map => {
map.set('in_reply_to', null);
map.set('text', '');
map.set('spoiler', false);
map.set('spoiler_text', '');
map.set('privacy', state.get('default_privacy'));
});
case COMPOSE_SUBMIT_REQUEST: