about summary refs log tree commit diff
path: root/app/assets/javascripts/components/actions/compose.jsx
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-24 01:28:37 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-24 01:28:37 +0100
commit60f2da1b2f0c12cc732eb4d3ac2750ba2164b49f (patch)
tree166095d8654690bf57152c9aa1d467ac070a8c30 /app/assets/javascripts/components/actions/compose.jsx
parent6e064cf715702636bd938dcf46fb1253503dbf04 (diff)
parent0bc6da89d2c57d3d90d2a71ee7d98d37569449f9 (diff)
Merge pull request #369 (nice)
Diffstat (limited to 'app/assets/javascripts/components/actions/compose.jsx')
-rw-r--r--app/assets/javascripts/components/actions/compose.jsx12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/actions/compose.jsx b/app/assets/javascripts/components/actions/compose.jsx
index 9c9ec9dde..05674ba89 100644
--- a/app/assets/javascripts/components/actions/compose.jsx
+++ b/app/assets/javascripts/components/actions/compose.jsx
@@ -24,6 +24,7 @@ export const COMPOSE_UNMOUNT = 'COMPOSE_UNMOUNT';
 
 export const COMPOSE_SENSITIVITY_CHANGE = 'COMPOSE_SENSITIVITY_CHANGE';
 export const COMPOSE_VISIBILITY_CHANGE  = 'COMPOSE_VISIBILITY_CHANGE';
+export const COMPOSE_LISTABILITY_CHANGE = 'COMPOSE_LISTABILITY_CHANGE';
 
 export function changeCompose(text) {
   return {
@@ -67,14 +68,14 @@ export function submitCompose() {
       in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null),
       media_ids: getState().getIn(['compose', 'media_attachments']).map(item => item.get('id')),
       sensitive: getState().getIn(['compose', 'sensitive']),
-      visibility: getState().getIn(['compose', 'private']) ? 'private' : 'public'
+      visibility: getState().getIn(['compose', 'private']) ? 'private' : (getState().getIn(['compose', 'unlisted']) ? 'unlisted' : 'public')
     }).then(function (response) {
       dispatch(submitComposeSuccess({ ...response.data }));
 
       // To make the app more responsive, immediately get the status into the columns
       dispatch(updateTimeline('home', { ...response.data }));
 
-      if (response.data.in_reply_to_id === null && !getState().getIn(['compose', 'private'])) {
+      if (response.data.in_reply_to_id === null && !getState().getIn(['compose', 'private']) && !getState().getIn(['compose', 'unlisted'])) {
         dispatch(updateTimeline('public', { ...response.data }));
       }
     }).catch(function (error) {
@@ -223,3 +224,10 @@ export function changeComposeVisibility(checked) {
     checked
   };
 };
+
+export function changeComposeListability(checked) {
+  return {
+    type: COMPOSE_LISTABILITY_CHANGE,
+    checked
+  };
+};