Merge remote-tracking branch 'origin/develop' into fix-self-reply
This commit is contained in:
commit
1cb6e4e3b3
|
@ -11,6 +11,7 @@ class ReplyMentions extends ImmutablePureComponent {
|
|||
onOpenMentionsModal: PropTypes.func.isRequired,
|
||||
explicitAddressing: PropTypes.bool,
|
||||
to: ImmutablePropTypes.orderedSet,
|
||||
parentTo: ImmutablePropTypes.orderedSet,
|
||||
isReply: PropTypes.bool,
|
||||
};
|
||||
|
||||
|
@ -21,12 +22,23 @@ class ReplyMentions extends ImmutablePureComponent {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { explicitAddressing, to, isReply } = this.props;
|
||||
const { explicitAddressing, to, parentTo, isReply } = this.props;
|
||||
|
||||
if (!explicitAddressing || !isReply || !to || to.size === 0) {
|
||||
if (!explicitAddressing || !isReply || !to || (parentTo.size === 0)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (to.size === 0) {
|
||||
return (
|
||||
<a href='#' className='reply-mentions' onClick={this.handleClick}>
|
||||
<FormattedMessage
|
||||
id='reply_mentions.reply_empty'
|
||||
defaultMessage='Replying to post'
|
||||
/>
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<a href='#' className='reply-mentions' onClick={this.handleClick}>
|
||||
<FormattedMessage
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { connect } from 'react-redux';
|
||||
|
||||
import { openModal } from 'soapbox/actions/modals';
|
||||
import { statusToMentionsAccountIdsArray } from 'soapbox/reducers/compose';
|
||||
import { makeGetStatus } from 'soapbox/selectors';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
|
||||
|
@ -28,8 +29,14 @@ const makeMapStateToProps = () => {
|
|||
}
|
||||
const to = state.getIn(['compose', 'to']);
|
||||
|
||||
const me = state.get('me');
|
||||
const account = state.getIn(['accounts', me]);
|
||||
|
||||
const parentTo = statusToMentionsAccountIdsArray(state, status, account);
|
||||
|
||||
return {
|
||||
to,
|
||||
parentTo,
|
||||
isReply: true,
|
||||
explicitAddressing: true,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue