about summary refs log tree commit diff
path: root/app/assets/javascripts/components/actions
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-23 18:53:23 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-23 18:53:23 +0100
commit2112a81e869fe342d7351b1fb1951df754a5d255 (patch)
tree5c06c40a97594aada843a429fb26137194ec048b /app/assets/javascripts/components/actions
parent5434ad3002b95f194a013fc327f1fdcabacf649a (diff)
Adding content sensitivity toggle, spoilers for media
Diffstat (limited to 'app/assets/javascripts/components/actions')
-rw-r--r--app/assets/javascripts/components/actions/compose.jsx12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/actions/compose.jsx b/app/assets/javascripts/components/actions/compose.jsx
index af3cdbf30..b97cb7b12 100644
--- a/app/assets/javascripts/components/actions/compose.jsx
+++ b/app/assets/javascripts/components/actions/compose.jsx
@@ -22,6 +22,8 @@ export const COMPOSE_SUGGESTION_SELECT = 'COMPOSE_SUGGESTION_SELECT';
 export const COMPOSE_MOUNT   = 'COMPOSE_MOUNT';
 export const COMPOSE_UNMOUNT = 'COMPOSE_UNMOUNT';
 
+export const COMPOSE_SENSITIVITY_CHANGE = 'COMPOSE_SENSITIVITY_CHANGE';
+
 export function changeCompose(text) {
   return {
     type: COMPOSE_CHANGE,
@@ -62,7 +64,8 @@ export function submitCompose() {
     api(getState).post('/api/v1/statuses', {
       status: getState().getIn(['compose', 'text'], ''),
       in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null),
-      media_ids: getState().getIn(['compose', 'media_attachments']).map(item => item.get('id'))
+      media_ids: getState().getIn(['compose', 'media_attachments']).map(item => item.get('id')),
+      sensitive: getState().getIn(['compose', 'sensitive'])
     }).then(function (response) {
       dispatch(submitComposeSuccess(response.data));
       dispatch(updateTimeline('home', response.data));
@@ -197,3 +200,10 @@ export function unmountCompose() {
     type: COMPOSE_UNMOUNT
   };
 };
+
+export function changeComposeSensitivity(checked) {
+  return {
+    type: COMPOSE_SENSITIVITY_CHANGE,
+    checked
+  };
+};