fix: support empty updatedAt in fedi

This commit is contained in:
alina 🌸 2024-08-05 00:39:00 +03:00
parent 17c7d889af
commit b453628fba
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
2 changed files with 2 additions and 2 deletions

View file

@ -19,7 +19,7 @@ const BODY = {
const schema = z.object({
id: z.string(),
createdAt: z.string(),
updatedAt: z.string(),
updatedAt: z.string().nullable().optional(),
text: z.nullable(z.string()),
})

View file

@ -41,7 +41,7 @@ export async function fetchLastSeen() {
res.push({
source: 'fedi',
sourceLink: 'https://very.stupid.fish/@teidesu',
time: new Date(fediData.updatedAt).getTime(),
time: new Date(fediData.updatedAt ?? fediData.createdAt).getTime(),
text: fediData.text?.slice(0, 40) || '[no text]',
link: `https://very.stupid.fish/notes/${fediData.id}`,
})