use account.ditto.external if present

environments/review-main-yi2y9f/deployments/4710^2
Siddharth Singh 3 months ago
parent 6aeb643e67
commit 73df5533bb
No known key found for this signature in database

@ -311,14 +311,19 @@ const Header: React.FC<IHeader> = ({ account }) => {
}); });
} }
if (features.federating && !account.local) { const ditto = account.ditto.external ? new URL(account.ditto.external).host : undefined;
const domain = account.fqn.split('@')[1]; if (features.federating && (!account.local || ditto)) {
const domain = ditto || account.fqn.split('@')[1];
const url = account.ditto.external || account.url;
menu.push({ if (domain && url) {
text: intl.formatMessage(messages.profileExternal, { domain }), menu.push({
action: () => onProfileExternal(account.url), text: intl.formatMessage(messages.profileExternal, { domain }),
icon: require('@tabler/icons/outline/external-link.svg'), action: () => onProfileExternal(url),
}); icon: require('@tabler/icons/outline/external-link.svg'),
href: url,
});
}
} }
menu.push({ menu.push({

@ -43,6 +43,7 @@ const baseAccountSchema = z.object({
ditto: coerceObject({ ditto: coerceObject({
accepts_zaps: z.boolean().catch(false), accepts_zaps: z.boolean().catch(false),
is_registered: z.boolean().catch(false), is_registered: z.boolean().catch(false),
external: z.string().optional().catch(undefined),
}), }),
emojis: filteredArray(customEmojiSchema), emojis: filteredArray(customEmojiSchema),
fields: filteredArray(fieldSchema), fields: filteredArray(fieldSchema),

Loading…
Cancel
Save