diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-09-05 16:56:43 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-09-05 16:56:43 +0200 |
commit | 05001d54d15c486caa6cebe9462222d37d87576d (patch) | |
tree | 29495b866edbe8500f8a2d10970da28c449509fd /app/assets/javascripts/components/containers | |
parent | 926eea89b51196821d49c7216f38faf0aedb4b09 (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.jsx | 15 |
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) }; }; |