about summary refs log tree commit diff
path: root/app/assets/javascripts/components/reducers/compose.jsx
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-03-25 19:30:56 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-03-25 19:30:56 +0100
commita9303e70627c1e79f73f0e37eafe7857df6d5533 (patch)
tree4702ae5bda26455c4ad7cda56b5422ac8496c76e /app/assets/javascripts/components/reducers/compose.jsx
parentad1af951fb8c74fa137e77dd2bea6dd47c1d4f73 (diff)
When replying to status with content warning, prefill content warning
Diffstat (limited to 'app/assets/javascripts/components/reducers/compose.jsx')
-rw-r--r--app/assets/javascripts/components/reducers/compose.jsx7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/assets/javascripts/components/reducers/compose.jsx b/app/assets/javascripts/components/reducers/compose.jsx
index a5deae930..4470ad643 100644
--- a/app/assets/javascripts/components/reducers/compose.jsx
+++ b/app/assets/javascripts/components/reducers/compose.jsx
@@ -152,11 +152,18 @@ export default function compose(state = initialState, action) {
       map.set('privacy', privacyPreference(action.status.get('visibility'), state.get('default_privacy')));
       map.set('focusDate', new Date());
       map.set('preselectDate', new Date());
+
+      if (action.status.get('spoiler_text').length > 0) {
+        map.set('spoiler', true);
+        map.set('spoiler_text', action.status.get('spoiler_text'));
+      }
     });
   case COMPOSE_REPLY_CANCEL:
     return state.withMutations(map => {
       map.set('in_reply_to', null);
       map.set('text', '');
+      map.set('spoiler', false);
+      map.set('spoiler_text', '');
       map.set('privacy', state.get('default_privacy'));
     });
   case COMPOSE_SUBMIT_REQUEST: