diff --git a/ceremony/src/lib/stores/state.svelte.ts b/ceremony/src/lib/stores/state.svelte.ts index efedf64be6..65218f20b9 100644 --- a/ceremony/src/lib/stores/state.svelte.ts +++ b/ceremony/src/lib/stores/state.svelte.ts @@ -15,7 +15,7 @@ type State = | "offline" | "noClient" -export type AllowanceState = "invited" | "waitingList" | undefined +export type AllowanceState = "invited" | "waitingList" | "join" | undefined export type ContributionState = "contribute" | "contributed" | "verifying" | "notContributed" diff --git a/ceremony/src/lib/supabase/index.ts b/ceremony/src/lib/supabase/index.ts index 16c528b869..73def46164 100644 --- a/ceremony/src/lib/supabase/index.ts +++ b/ceremony/src/lib/supabase/index.ts @@ -104,7 +104,7 @@ export const getContributionState = async (): Promise => { export const getAllowanceState = async (userId: string | undefined): Promise => { if (!userId) { console.log("Need to be logged in to get allowance state") - return + return undefined } const { data, error } = await queryAllowance() @@ -113,5 +113,5 @@ export const getAllowanceState = async (userId: string | undefined): Promise { +$effect.pre(() => { const userId = user.session?.user.id if (userId) contributor.setUserId(userId) }) - + {#if contributor.loggedIn} - {#if contributor.allowanceState === "invited"} + {#if !contributor.allowanceState} + + {:else if contributor.allowanceState === "invited"} {:else if contributor.allowanceState === "waitingList"} -

Your on the list

- {:else} +

You're on the list

+ {:else if contributor.allowanceState === "join"} {/if} {:else} -

Welcome to union ceremony

+

Welcome to the union ceremony

{/if} diff --git a/ceremony/src/routes/auth/register/+page.svelte b/ceremony/src/routes/auth/register/+page.svelte index d773e428b2..fd64ea7b90 100644 --- a/ceremony/src/routes/auth/register/+page.svelte +++ b/ceremony/src/routes/auth/register/+page.svelte @@ -12,7 +12,7 @@ let loading = false async function register() { loading = true - await auth(`${$page.url.origin}/app`) + await auth(`${$page.url.origin}/`) }