[Glitch] Fix Followers/Following list error when they contain accounts that have never posted

Port a89608180868df79f786d9e79edefcb02577596b to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
diondiondion 2026-04-10 16:06:35 +02:00 committed by Claire
parent 04b3f0fc32
commit 01a0fb382d
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 (