From 751ebe58a46ba188e06ee1e23ad46a3029c2b2ba Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 28 Oct 2024 21:16:23 +0100 Subject: [PATCH] feat(ceremony): preparing queue --- .../src/lib/components/Terminal/Join.svelte | 112 ++++++++++++------ ceremony/src/lib/state/contributor.svelte.ts | 4 +- ceremony/src/lib/supabase/index.ts | 1 - ceremony/src/lib/supabase/queries.ts | 2 +- ceremony/src/routes/+page.svelte | 6 +- 5 files changed, 81 insertions(+), 44 deletions(-) diff --git a/ceremony/src/lib/components/Terminal/Join.svelte b/ceremony/src/lib/components/Terminal/Join.svelte index 5cb6ef43e2..5ac1ff937c 100644 --- a/ceremony/src/lib/components/Terminal/Join.svelte +++ b/ceremony/src/lib/components/Terminal/Join.svelte @@ -1,20 +1,18 @@ -{#if !selected} - {#if code } - - {:else } - trigger(value)}/> +{#if !showConfirm} + +{:else} + {#if loading} + Loading... + {:else} + {/if} {/if} diff --git a/ceremony/src/lib/state/contributor.svelte.ts b/ceremony/src/lib/state/contributor.svelte.ts index 0eec7aad77..1deefffbc8 100644 --- a/ceremony/src/lib/state/contributor.svelte.ts +++ b/ceremony/src/lib/state/contributor.svelte.ts @@ -22,7 +22,7 @@ type State = | "noClient" | "missed" -export type AllowanceState = "hasRedeemed" | "inWaitlist" | "inQueue" | "join" | undefined +export type AllowanceState = "hasRedeemed" | "inQueue" | "join" | undefined export type ContributionState = | "contribute" @@ -116,7 +116,7 @@ export class Contributor { this.state = "loading" this.clientState = undefined this.contributionState = undefined - this.userWallet = null + this.userWallet = undefined this.queueState = { position: null, count: null diff --git a/ceremony/src/lib/supabase/index.ts b/ceremony/src/lib/supabase/index.ts index ee58bf28cf..f88f545d21 100644 --- a/ceremony/src/lib/supabase/index.ts +++ b/ceremony/src/lib/supabase/index.ts @@ -140,7 +140,6 @@ export const getCurrentUserState = async (userId: string | undefined): Promise { export const queryCurrentUserState = async () => { const { data, error } = await supabase .from("current_user_state") - .select("in_waitlist, has_redeemed, in_queue, waitlist_position") + .select("has_redeemed, in_queue, waitlist_position") .single() return { data, error } diff --git a/ceremony/src/routes/+page.svelte b/ceremony/src/routes/+page.svelte index 5934709617..aa56873d99 100644 --- a/ceremony/src/routes/+page.svelte +++ b/ceremony/src/routes/+page.svelte @@ -63,16 +63,18 @@ onMount(() => { Loading {/if} - {:else if contributor.currentUserState === "inWaitlist"} - + + {:else if contributor.currentUserState === "join"} {/if} {/if} + {:else if user.session === null && terminal.tab === 1} {/if} + {/if}