accountSchema: get the domain from the API if it's available

environments/review-make-remot-f3myvi/deployments/4771
Alex Gleason 2024-08-16 20:43:49 -05:00
rodzic 041250c2a1
commit 0323ef9796
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -45,6 +45,7 @@ const baseAccountSchema = z.object({
is_registered: z.boolean().catch(false),
external_url: z.string().optional().catch(undefined),
}),
domain: z.string().optional().catch(undefined),
emojis: filteredArray(customEmojiSchema),
fields: filteredArray(fieldSchema),
followers_count: z.number().catch(0),
@ -145,7 +146,7 @@ const transformAccount = <T extends TransformableAccount>({ pleroma, other_setti
}));
const displayName = account.display_name.trim().length === 0 ? account.username : account.display_name;
const domain = getDomain(account.url || account.uri);
const domain = account.domain ?? getDomain(account.url || account.uri);
if (pleroma) {
pleroma.birthday = pleroma.birthday || other_settings?.birthday;