diff --git a/app/soapbox/components/status.js b/app/soapbox/components/status.js index ff9a2eb38..89f0fe934 100644 --- a/app/soapbox/components/status.js +++ b/app/soapbox/components/status.js @@ -88,7 +88,6 @@ class Status extends ImmutablePureComponent { unread: PropTypes.bool, onMoveUp: PropTypes.func, onMoveDown: PropTypes.func, - showThread: PropTypes.bool, getScrollPosition: PropTypes.func, updateScrollBottom: PropTypes.func, cacheMediaWidth: PropTypes.func, @@ -318,7 +317,7 @@ class Status extends ImmutablePureComponent { const poll = null; let statusAvatar, prepend, rebloggedByText, reblogContent; - const { intl, hidden, featured, otherAccounts, unread, showThread, group } = this.props; + const { intl, hidden, featured, otherAccounts, unread, group } = this.props; // FIXME: why does this need to reassign status and account?? let { status, account, ...other } = this.props; // eslint-disable-line prefer-const @@ -553,12 +552,6 @@ class Status extends ImmutablePureComponent { {media} {poll} - {showThread && status.get('in_reply_to_id') && status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) && ( - - )} - ); } @@ -138,7 +137,6 @@ export default class StatusList extends ImmutablePureComponent { contextType={timelineId} group={group} withGroupAdmin={withGroupAdmin} - showThread /> @@ -157,7 +155,6 @@ export default class StatusList extends ImmutablePureComponent { onMoveUp={this.handleMoveUp} onMoveDown={this.handleMoveDown} contextType={timelineId} - showThread /> )); } diff --git a/app/soapbox/components/status_reply_mentions.js b/app/soapbox/components/status_reply_mentions.js index aaa934008..580880fee 100644 --- a/app/soapbox/components/status_reply_mentions.js +++ b/app/soapbox/components/status_reply_mentions.js @@ -15,12 +15,46 @@ class StatusReplyMentions extends ImmutablePureComponent { render() { const { status } = this.props; - const to = status.get('mentions', []); - - if (!status.get('in_reply_to_id') || !to || to.size === 0) { + if (!status.get('in_reply_to_id')) { return null; } + const to = status.get('mentions', []); + + // The post is a reply, but it has no mentions. + if (to.size === 0) { + // The author is replying to themself. + if (status.get('in_reply_to_account_id') === status.getIn(['account', 'id'])) { + return ( +
+ + + @{status.getIn(['account', 'username'])} + + ), + more: false, + }} + /> +
+ ); + } else { + // The reply-to is unknown. Rare, but it can happen. + return ( +
+ +
+ ); + } + } + + // The typical case with a reply-to and a list of mentions. return (
(<> - @{account.get('acct').split('@')[0]} + @{account.get('username')} {' '} )), @@ -44,4 +78,4 @@ class StatusReplyMentions extends ImmutablePureComponent { ); } -} \ No newline at end of file +} diff --git a/app/soapbox/features/scheduled_statuses/components/scheduled_status.js b/app/soapbox/features/scheduled_statuses/components/scheduled_status.js index 5226125fc..2295a0d70 100644 --- a/app/soapbox/features/scheduled_statuses/components/scheduled_status.js +++ b/app/soapbox/features/scheduled_statuses/components/scheduled_status.js @@ -1,6 +1,5 @@ import React from 'react'; import { connect } from 'react-redux'; -import { FormattedMessage } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import StatusContent from 'soapbox/components/status_content'; import { buildStatus } from '../builder'; @@ -25,7 +24,7 @@ export default @connect(mapStateToProps) class ScheduledStatus extends ImmutablePureComponent { render() { - const { status, showThread, account, ...other } = this.props; + const { status, account, ...other } = this.props; if (!status.get('account')) return null; const statusUrl = `/scheduled_statuses/${status.get('id')}`; @@ -74,12 +73,6 @@ class ScheduledStatus extends ImmutablePureComponent { {status.get('poll') && } - {showThread && status.get('in_reply_to_id') && status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) && ( - - )} -
diff --git a/app/soapbox/features/ui/components/pending_status.js b/app/soapbox/features/ui/components/pending_status.js index 638b896c9..44830822a 100644 --- a/app/soapbox/features/ui/components/pending_status.js +++ b/app/soapbox/features/ui/components/pending_status.js @@ -1,6 +1,5 @@ import React from 'react'; import { connect } from 'react-redux'; -import { FormattedMessage } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import StatusContent from 'soapbox/components/status_content'; import { buildStatus } from '../util/pending_status_builder'; @@ -46,7 +45,7 @@ class PendingStatus extends ImmutablePureComponent { } render() { - const { status, className, showThread } = this.props; + const { status, className } = this.props; if (!status) return null; if (!status.get('account')) return null; @@ -91,12 +90,6 @@ class PendingStatus extends ImmutablePureComponent { {this.renderMedia()} {status.get('poll') && } - {showThread && status.get('in_reply_to_id') && status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) && ( - - )} - {/* TODO */} {/* */}