reset advanced options when appropriate

This commit is contained in:
Surinna Curtis 2017-07-01 17:36:56 -05:00 committed by Gô Shoemake
parent 49e82c1e0f
commit 0c71c0ccc8
1 changed files with 6 additions and 0 deletions

View File

@ -48,6 +48,9 @@ const initialState = Immutable.Map({
suggestion_token: null,
suggestions: Immutable.List(),
me: null,
default_advanced_options: Immutable.Map({
do_not_federate: false
}),
default_privacy: 'public',
resetFileKey: Math.floor((Math.random() * 0x10000)),
idempotencyKey: null,
@ -71,6 +74,7 @@ function clearAll(state) {
map.set('spoiler_text', '');
map.set('is_submitting', false);
map.set('in_reply_to', null);
map.set('advanced_options', state.get('default_advanced_options'));
map.set('privacy', state.get('default_privacy'));
map.set('sensitive', false);
map.update('media_attachments', list => list.clear());
@ -176,6 +180,7 @@ export default function compose(state = initialState, action) {
map.set('in_reply_to', action.status.get('id'));
map.set('text', statusToTextMentions(state, action.status));
map.set('privacy', privacyPreference(action.status.get('visibility'), state.get('default_privacy')));
map.set('advanced_options', state.get('default_advanced_options'));
map.set('focusDate', new Date());
map.set('preselectDate', new Date());
map.set('idempotencyKey', uuid());
@ -195,6 +200,7 @@ export default function compose(state = initialState, action) {
map.set('spoiler', false);
map.set('spoiler_text', '');
map.set('privacy', state.get('default_privacy'));
map.set('advanced_options', state.get('default_advanced_options'));
map.set('idempotencyKey', uuid());
});
case COMPOSE_SUBMIT_REQUEST: