API returns mentions for statuses, compose form pre-fills all relevant usernames into the form when replying
This commit is contained in:
parent
94525b596a
commit
bc98865c1a
4 changed files with 21 additions and 17 deletions
|
@ -1,25 +1,13 @@
|
|||
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;
|
||||
};
|
||||
import { selectStatus } from '../../../reducers/timelines';
|
||||
|
||||
const mapStateToProps = function (state, props) {
|
||||
return {
|
||||
text: state.getIn(['compose', 'text']),
|
||||
is_submitting: state.getIn(['compose', 'is_submitting']),
|
||||
in_reply_to: selectStatus(state)
|
||||
in_reply_to: selectStatus(state, state.getIn(['compose', 'in_reply_to']))
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue