about summary refs log tree commit diff
path: root/app/assets/javascripts/components/reducers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-06 23:16:20 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-06 23:16:20 +0100
commit347a153b3dc73068aedf7510c395cc350a553629 (patch)
tree8befe52ea5aa0525aae8ecd08f32a4e820d33471 /app/assets/javascripts/components/reducers
parent4d2be9f43273d010d683a0fccda97974b7249579 (diff)
Add API modifiers to limit returned toots from public/hashtag timelines
to only those from local users; Add link to "extended information" to
getting started in the UI; Add defaults for posting privacy; Change
how publish button looks depending on posting privacy chosen
Diffstat (limited to 'app/assets/javascripts/components/reducers')
-rw-r--r--app/assets/javascripts/components/reducers/compose.jsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/reducers/compose.jsx b/app/assets/javascripts/components/reducers/compose.jsx
index d3a84842f..1b903ed44 100644
--- a/app/assets/javascripts/components/reducers/compose.jsx
+++ b/app/assets/javascripts/components/reducers/compose.jsx
@@ -43,6 +43,7 @@ const initialState = Immutable.Map({
   suggestion_token: null,
   suggestions: Immutable.List(),
   me: null,
+  default_privacy: 'public',
   resetFileKey: Math.floor((Math.random() * 0x10000))
 });
 
@@ -64,6 +65,8 @@ function clearAll(state) {
     map.set('spoiler_text', '');
     map.set('is_submitting', false);
     map.set('in_reply_to', null);
+    map.set('unlisted', state.get('default_privacy') === 'unlisted');
+    map.set('private', state.get('default_privacy') === 'private');
     map.update('media_attachments', list => list.clear());
   });
 };
@@ -97,7 +100,7 @@ const insertSuggestion = (state, position, token, completion) => {
 export default function compose(state = initialState, action) {
   switch(action.type) {
   case STORE_HYDRATE:
-    return state.merge(action.state.get('compose'));
+    return clearAll(state.merge(action.state.get('compose')));
   case COMPOSE_MOUNT:
     return state.set('mounted', true);
   case COMPOSE_UNMOUNT: