diff --git a/src/lib/components/GoogleAuthButton.svelte b/src/lib/components/GoogleAuthButton.svelte index da0ca5d..b84361e 100644 --- a/src/lib/components/GoogleAuthButton.svelte +++ b/src/lib/components/GoogleAuthButton.svelte @@ -6,12 +6,14 @@ let { onSuccess, onError, + onDisconnect, disabled = false, size = 'default', variant = 'primary' } = $props<{ onSuccess?: (token: string) => void; onError?: (error: string) => void; + onDisconnect?: () => void; disabled?: boolean; size?: 'small' | 'default' | 'large'; variant?: 'primary' | 'secondary'; @@ -41,6 +43,7 @@ async function handleDisconnect() { await authManager.disconnectGoogle(); + onDisconnect?.(); } // Size classes diff --git a/src/routes/private/events/event/new/+page.svelte b/src/routes/private/events/event/new/+page.svelte index dcaf5df..741592b 100644 --- a/src/routes/private/events/event/new/+page.svelte +++ b/src/routes/private/events/event/new/+page.svelte @@ -1,6 +1,5 @@ @@ -455,16 +268,9 @@
{#if currentStep === 0} { - authData.error = null; - authData.token = token; - authData.isConnected = true; - setTimeout(checkGoogleAuth, 100); - }} - onError={(error) => { - authData.error = error; - authData.isConnected = false; - }} + onSuccess={() => (isGoogleConnected = true)} + onDisconnect={() => (isGoogleConnected = false)} + onError={(err) => toast.error(err)} /> {:else if currentStep === 1} @@ -485,7 +291,7 @@ void; onError?: (error: string) => void; + onDisconnect?: () => void; }>(); @@ -15,11 +16,12 @@ To create events and import participants from Google Sheets, you need to connect your Google account.

- +