mirror of
https://github.com/mastodon/mastodon.git
synced 2026-10-21 20:13:18 -05:00
Status redesign: Check for account ID when displaying link authors (#40808)
This commit is contained in:
@@ -413,6 +413,10 @@ const LinkCard: React.FC<{ card: CardShape; status: ExpandedStatusShape }> = ({
|
||||
rel: 'noopener',
|
||||
} as const;
|
||||
|
||||
const authors = card.authors
|
||||
.map(({ accountId }) => accountId)
|
||||
.filter((id): id is string => !!id);
|
||||
|
||||
return (
|
||||
<Card>
|
||||
<CardTitle
|
||||
@@ -440,18 +444,18 @@ const LinkCard: React.FC<{ card: CardShape; status: ExpandedStatusShape }> = ({
|
||||
</CardBody>
|
||||
)}
|
||||
|
||||
{card.authors.length > 0 && (
|
||||
{authors.length > 0 && (
|
||||
<CardActions>
|
||||
<FormattedMessage
|
||||
id='status.link_preview.authors'
|
||||
defaultMessage='{count, plural, one {Find the author in the Fediverse:} other {Find the authors in the Fediverse:}}'
|
||||
values={{
|
||||
count: card.authors.length,
|
||||
count: authors.length,
|
||||
}}
|
||||
tagName='span'
|
||||
/>
|
||||
|
||||
{card.authors.map(({ accountId }) => (
|
||||
{authors.map((accountId) => (
|
||||
<LinkCardAuthor authorId={accountId} key={accountId} />
|
||||
))}
|
||||
</CardActions>
|
||||
|
||||
Reference in New Issue
Block a user