|
|
@ -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('privacy', privacyPreference(action.status.get('visibility'), state.get('default_privacy')));
|
|
|
|
map.set('focusDate', new Date());
|
|
|
|
map.set('focusDate', new Date());
|
|
|
|
map.set('preselectDate', 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:
|
|
|
|
case COMPOSE_REPLY_CANCEL:
|
|
|
|
return state.withMutations(map => {
|
|
|
|
return state.withMutations(map => {
|
|
|
|
map.set('in_reply_to', null);
|
|
|
|
map.set('in_reply_to', null);
|
|
|
|
map.set('text', '');
|
|
|
|
map.set('text', '');
|
|
|
|
|
|
|
|
map.set('spoiler', false);
|
|
|
|
|
|
|
|
map.set('spoiler_text', '');
|
|
|
|
map.set('privacy', state.get('default_privacy'));
|
|
|
|
map.set('privacy', state.get('default_privacy'));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
case COMPOSE_SUBMIT_REQUEST:
|
|
|
|
case COMPOSE_SUBMIT_REQUEST:
|
|
|
|