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,
|
onOpenMentionsModal: PropTypes.func.isRequired,
|
||||||
explicitAddressing: PropTypes.bool,
|
explicitAddressing: PropTypes.bool,
|
||||||
to: ImmutablePropTypes.orderedSet,
|
to: ImmutablePropTypes.orderedSet,
|
||||||
|
parentTo: ImmutablePropTypes.orderedSet,
|
||||||
isReply: PropTypes.bool,
|
isReply: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -21,12 +22,23 @@ class ReplyMentions extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
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;
|
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 (
|
return (
|
||||||
<a href='#' className='reply-mentions' onClick={this.handleClick}>
|
<a href='#' className='reply-mentions' onClick={this.handleClick}>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { openModal } from 'soapbox/actions/modals';
|
import { openModal } from 'soapbox/actions/modals';
|
||||||
|
import { statusToMentionsAccountIdsArray } from 'soapbox/reducers/compose';
|
||||||
import { makeGetStatus } from 'soapbox/selectors';
|
import { makeGetStatus } from 'soapbox/selectors';
|
||||||
import { getFeatures } from 'soapbox/utils/features';
|
import { getFeatures } from 'soapbox/utils/features';
|
||||||
|
|
||||||
|
@ -28,8 +29,14 @@ const makeMapStateToProps = () => {
|
||||||
}
|
}
|
||||||
const to = state.getIn(['compose', 'to']);
|
const to = state.getIn(['compose', 'to']);
|
||||||
|
|
||||||
|
const me = state.get('me');
|
||||||
|
const account = state.getIn(['accounts', me]);
|
||||||
|
|
||||||
|
const parentTo = statusToMentionsAccountIdsArray(state, status, account);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
to,
|
to,
|
||||||
|
parentTo,
|
||||||
isReply: true,
|
isReply: true,
|
||||||
explicitAddressing: true,
|
explicitAddressing: true,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue