kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
use account.ditto.external if present
rodzic
6aeb643e67
commit
73df5533bb
|
@ -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),
|
||||||
|
|
Ładowanie…
Reference in New Issue