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 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),
|
||||
|
|
Ładowanie…
Reference in New Issue