diff --git a/apps/dashboard/src/lib/components/AuthUI/index.svelte b/apps/dashboard/src/lib/components/AuthUI/index.svelte index c029ad82..7a6e1c50 100644 --- a/apps/dashboard/src/lib/components/AuthUI/index.svelte +++ b/apps/dashboard/src/lib/components/AuthUI/index.svelte @@ -18,8 +18,6 @@ export let hideGoogleAuth = false; export let redirectPathname = ''; - $: console.log('redirectPathname', redirectPathname); - async function signInWithGoogle() { if (isLoading) { return; diff --git a/apps/dashboard/src/lib/utils/store/user.ts b/apps/dashboard/src/lib/utils/store/user.ts index d0191f8b..2dc8f4ff 100644 --- a/apps/dashboard/src/lib/utils/store/user.ts +++ b/apps/dashboard/src/lib/utils/store/user.ts @@ -1,6 +1,6 @@ -import { writable } from 'svelte/store'; -import type { User } from '@supabase/supabase-js'; import { LOCALE } from '../types'; +import type { User } from '@supabase/supabase-js'; +import { writable } from 'svelte/store'; interface UserStore { openAuthModal: boolean; @@ -29,7 +29,7 @@ interface ProfileStore { export const defaultUserState: UserStore = { openAuthModal: false, - fetchingUser: false, + fetchingUser: true, isLoggedIn: false, currentSession: undefined, expiresAt: 0 diff --git a/apps/dashboard/src/routes/invite/t/[hash]/+page.svelte b/apps/dashboard/src/routes/invite/t/[hash]/+page.svelte index e3770525..8a62f3cf 100644 --- a/apps/dashboard/src/routes/invite/t/[hash]/+page.svelte +++ b/apps/dashboard/src/routes/invite/t/[hash]/+page.svelte @@ -11,7 +11,7 @@ import { getSupabase } from '$lib/utils/functions/supabase'; import { setTheme } from '$lib/utils/functions/theme'; import { t } from '$lib/utils/functions/translations'; - import { profile } from '$lib/utils/store/user'; + import { profile, user } from '$lib/utils/store/user'; import { authValidation, getConfirmPasswordError, @@ -176,6 +176,8 @@ shouldLogout = true; } } + + $: isLoading = loading || $user.fetchingUser; @@ -187,7 +189,7 @@ redirectPathname={$page.url.pathname} isLogin={false} {handleSubmit} - isLoading={loading} + {isLoading} showLogo={true} bind:formRef > @@ -276,8 +278,8 @@ label="Accept Invite" type="submit" className="sm:w-full w-full" - isDisabled={disableSubmit || loading} - isLoading={loading} + isDisabled={disableSubmit} + {isLoading} /> {/if}