From 0c71c0ccc835825e4c6fb47a56bd09a237103ac6 Mon Sep 17 00:00:00 2001 From: Surinna Curtis Date: Sat, 1 Jul 2017 17:36:56 -0500 Subject: reset advanced options when appropriate --- app/javascript/mastodon/reducers/compose.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app') diff --git a/app/javascript/mastodon/reducers/compose.js b/app/javascript/mastodon/reducers/compose.js index 9713f5ed9..ca22f5fbe 100644 --- a/app/javascript/mastodon/reducers/compose.js +++ b/app/javascript/mastodon/reducers/compose.js @@ -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: -- cgit