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

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

Loading…
Cancel
Save