diff --git a/src/features/profile/LinkAccounts.jsx b/src/features/profile/LinkAccounts.jsx index 3408e4364..7174a90fa 100644 --- a/src/features/profile/LinkAccounts.jsx +++ b/src/features/profile/LinkAccounts.jsx @@ -23,6 +23,10 @@ export function LinkAccounts() { ) const [refreshing, setRefreshing] = React.useState(false) + // only a local session (which carries no strategy) can link accounts, and + // pick which one alerts, Discord and Telegram sign-ins use their own + const isLocal = !['discord', 'telegram'].includes(auth.strategy) + const showWebhookStrategy = isLocal && !!auth.discordId && !!auth.telegramId const [setWebhookStrategy] = useMutation(Query.user('SET_WEBHOOK_STRATEGY')) @@ -35,6 +39,7 @@ export function LinkAccounts() { {METHODS.map((method, i) => { if (!auth.methods.includes(method)) return null + if (!auth[`${method}Id`] && !isLocal) return null const Component = i ? ( ) })} - {auth.discordId && auth.telegramId && ( + {showWebhookStrategy && ( {t('select_webhook_strategy')}