about summary refs log tree commit diff
path: root/app/assets/javascripts/components/containers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-05 16:56:43 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-05 16:56:43 +0200
commit05001d54d15c486caa6cebe9462222d37d87576d (patch)
tree29495b866edbe8500f8a2d10970da28c449509fd /app/assets/javascripts/components/containers
parent926eea89b51196821d49c7216f38faf0aedb4b09 (diff)
Make compose form also use normalized data
Diffstat (limited to 'app/assets/javascripts/components/containers')
-rw-r--r--app/assets/javascripts/components/containers/compose_form_container.jsx15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/containers/compose_form_container.jsx b/app/assets/javascripts/components/containers/compose_form_container.jsx
index 534830c27..d49217a90 100644
--- a/app/assets/javascripts/components/containers/compose_form_container.jsx
+++ b/app/assets/javascripts/components/containers/compose_form_container.jsx
@@ -2,11 +2,24 @@ import { connect }                                          from 'react-redux';
 import ComposeForm                                          from '../components/compose_form';
 import { changeCompose, submitCompose, cancelReplyCompose } from '../actions/compose';
 
+function selectStatus(state) {
+  let statusId = state.getIn(['compose', 'in_reply_to'], null);
+
+  if (statusId === null) {
+    return null;
+  }
+
+  let status = state.getIn(['timelines', 'statuses', statusId]);
+  status = status.set('account', state.getIn(['timelines', 'accounts', status.get('account')]));
+
+  return status;
+};
+
 const mapStateToProps = function (state, props) {
   return {
     text: state.getIn(['compose', 'text']),
     is_submitting: state.getIn(['compose', 'is_submitting']),
-    in_reply_to: state.getIn(['compose', 'in_reply_to'])
+    in_reply_to: selectStatus(state)
   };
 };