Fix Followers/Following list error when they contain accounts that have never posted (#38640)

This commit is contained in:
diondiondion 2026-04-10 16:06:35 +02:00 committed by GitHub
parent df4b4f1620
commit a896081808
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 8 deletions

View File

@ -53,7 +53,7 @@ export interface BaseApiAccountJSON {
header_static: string;
header_description: string;
id: string;
last_status_at: string;
last_status_at: string | null;
locked: boolean;
show_media: boolean;
show_media_replies: boolean;

View File

@ -148,11 +148,15 @@ export const AccountListItem: React.FC<Props> = ({
/>
}
>
<RelativeTimestamp
long
timestamp={account.last_status_at}
noFuture
/>
{account.last_status_at ? (
<RelativeTimestamp
long
timestamp={account.last_status_at}
noFuture
/>
) : (
'-'
)}
</NumberFieldsItem>
)}
{firstVerifiedField && (

View File

@ -61,9 +61,11 @@ const AddedAccountItem: React.FC<{
onRemove(accountId);
}, [accountId, onRemove]);
const lastStatusAt = account?.last_status_at;
const lastPostHint = useMemo(
() =>
isOlderThanAWeek(account?.last_status_at) && (
(!lastStatusAt || isOlderThanAWeek(lastStatusAt)) && (
<Badge
label={
<FormattedMessage
@ -75,7 +77,7 @@ const AddedAccountItem: React.FC<{
className={classes.accountBadge}
/>
),
[account?.last_status_at],
[lastStatusAt],
);
return (