[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:
parent
04b3f0fc32
commit
01a0fb382d
@ -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;
|
||||
|
||||
@ -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 && (
|
||||
|
||||
@ -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 (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user