{
- const { status } = this.props;
-
- if (!status.get('in_reply_to_id')) {
- return null;
- }
-
- const to = status.get('mentions', []);
-
- if (to.size === 0) {
- if (status.get('in_reply_to_account_id') === status.getIn(['account', 'id'])) {
- return (
-
- @{status.getIn(['account', 'username'])},
- more: false,
- }}
- />
-
- );
- } else {
- return (
-
-
-
- );
- }
- }
-
-
- return (
-
- (<>
- @{account.username}
- {' '}
- >)),
- more: to.size > 2 && ,
- }}
- />
-
- );
- }
-
render() {
const { status, className } = this.props;
if (!status) return null;
@@ -137,7 +88,7 @@ class PendingStatus extends ImmutablePureComponent {
- {this.renderReplyMentions()}
+
{
@@ -21,8 +22,9 @@ export const buildStatus = (state, pendingStatus, idempotencyKey) => {
mentions = pendingStatus.get('to', []);
}
- mentions = mentions.map(mention => ({
+ mentions = mentions.toList().map(mention => ImmutableMap({
username: mention.split('@')[0],
+ acct: mention,
}));
}
@@ -59,5 +61,5 @@ export const buildStatus = (state, pendingStatus, idempotencyKey) => {
visibility: pendingStatus.get('visibility', 'public'),
};
- return normalizeStatus(fromJS(status));
+ return calculateStatus(normalizeStatus(fromJS(status)));
};
diff --git a/app/soapbox/reducers/statuses.js b/app/soapbox/reducers/statuses.js
index e1af8cf30..ab822b59f 100644
--- a/app/soapbox/reducers/statuses.js
+++ b/app/soapbox/reducers/statuses.js
@@ -48,7 +48,7 @@ const minifyStatus = status => {
// Only calculate these values when status first encountered
// Otherwise keep the ones already in the reducer
-const calculateStatus = (status, oldStatus, expandSpoilers = false) => {
+export const calculateStatus = (status, oldStatus, expandSpoilers = false) => {
if (oldStatus) {
return status.merge({
search_index: oldStatus.get('search_index'),