From 2635d9b109df9c3959befdfd99e04d5e35edc592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Mon, 21 Feb 2022 09:56:23 +0100 Subject: [PATCH] Compose: Show 'Replying to a post' if unchecked all mentions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../compose/components/reply_mentions.js | 16 ++++++++++++++-- .../containers/reply_mentions_container.js | 7 +++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/soapbox/features/compose/components/reply_mentions.js b/app/soapbox/features/compose/components/reply_mentions.js index a6ebbbc7e..5bc6615ac 100644 --- a/app/soapbox/features/compose/components/reply_mentions.js +++ b/app/soapbox/features/compose/components/reply_mentions.js @@ -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 ( + + + + ); + } + return ( { } 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, };