[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_static: string;
|
||||||
header_description: string;
|
header_description: string;
|
||||||
id: string;
|
id: string;
|
||||||
last_status_at: string;
|
last_status_at: string | null;
|
||||||
locked: boolean;
|
locked: boolean;
|
||||||
show_media: boolean;
|
show_media: boolean;
|
||||||
show_media_replies: boolean;
|
show_media_replies: boolean;
|
||||||
|
|||||||
@ -148,11 +148,15 @@ export const AccountListItem: React.FC<Props> = ({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<RelativeTimestamp
|
{account.last_status_at ? (
|
||||||
long
|
<RelativeTimestamp
|
||||||
timestamp={account.last_status_at}
|
long
|
||||||
noFuture
|
timestamp={account.last_status_at}
|
||||||
/>
|
noFuture
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
'-'
|
||||||
|
)}
|
||||||
</NumberFieldsItem>
|
</NumberFieldsItem>
|
||||||
)}
|
)}
|
||||||
{firstVerifiedField && (
|
{firstVerifiedField && (
|
||||||
|
|||||||
@ -61,9 +61,11 @@ const AddedAccountItem: React.FC<{
|
|||||||
onRemove(accountId);
|
onRemove(accountId);
|
||||||
}, [accountId, onRemove]);
|
}, [accountId, onRemove]);
|
||||||
|
|
||||||
|
const lastStatusAt = account?.last_status_at;
|
||||||
|
|
||||||
const lastPostHint = useMemo(
|
const lastPostHint = useMemo(
|
||||||
() =>
|
() =>
|
||||||
isOlderThanAWeek(account?.last_status_at) && (
|
(!lastStatusAt || isOlderThanAWeek(lastStatusAt)) && (
|
||||||
<Badge
|
<Badge
|
||||||
label={
|
label={
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
@ -75,7 +77,7 @@ const AddedAccountItem: React.FC<{
|
|||||||
className={classes.accountBadge}
|
className={classes.accountBadge}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
[account?.last_status_at],
|
[lastStatusAt],
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user