Compose: Show 'Replying to a post' if unchecked all mentions

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2022-02-21 09:56:23 +01:00
parent 6ceecc08b2
commit 2635d9b109
2 changed files with 21 additions and 2 deletions

View File

@@ -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