From c29cab7daa2e0448ba2860be584a13cbc5c709f2 Mon Sep 17 00:00:00 2001 From: TangZhiZzz <70746511+TangZhiZzz@users.noreply.github.com> Date: Wed, 19 Mar 2025 20:06:31 +0800 Subject: [PATCH] fix: Unknown event handler property onsuccess . (#3603) * chore(version): 1.1.8 * Update OAuthButton.tsx --------- Co-authored-by: kangfenmao --- src/renderer/src/components/OAuth/OAuthButton.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/renderer/src/components/OAuth/OAuthButton.tsx b/src/renderer/src/components/OAuth/OAuthButton.tsx index fd717298..09b2a8c7 100644 --- a/src/renderer/src/components/OAuth/OAuthButton.tsx +++ b/src/renderer/src/components/OAuth/OAuthButton.tsx @@ -9,28 +9,27 @@ interface Props extends ButtonProps { onSuccess?: (key: string) => void } -const OAuthButton: FC = ({ provider, ...props }) => { +const OAuthButton: FC = ({ provider, onSuccess, ...buttonProps }) => { const { t } = useTranslation() - const onAuth = () => { - const onSuccess = (key: string) => { + const handleSuccess = (key: string) => { if (key.trim()) { - props.onSuccess?.(key) + onSuccess?.(key) window.message.success({ content: t('auth.get_key_success'), key: 'auth-success' }) } } if (provider.id === 'silicon') { - oauthWithSiliconFlow(onSuccess) + oauthWithSiliconFlow(handleSuccess) } if (provider.id === 'aihubmix') { - oauthWithAihubmix(onSuccess) + oauthWithAihubmix(handleSuccess) } } return ( - )