From 7a65eaaa0a9e5c2118cdd5836bd3e720658e9fc5 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 2 Oct 2024 22:48:41 +0200 Subject: [PATCH 1/2] fix(ceremony): fix numbers in step --- ceremony/src/lib/components/Terminal/Code.svelte | 2 +- ceremony/src/lib/components/Terminal/Join.svelte | 4 ++-- ceremony/src/lib/components/Terminal/Missed.svelte | 2 +- ceremony/src/lib/components/Terminal/Queue.svelte | 2 +- ceremony/src/lib/components/Terminal/Waitlist.svelte | 2 +- ceremony/src/routes/+page.svelte | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ceremony/src/lib/components/Terminal/Code.svelte b/ceremony/src/lib/components/Terminal/Code.svelte index b82114e019..770848d3ba 100644 --- a/ceremony/src/lib/components/Terminal/Code.svelte +++ b/ceremony/src/lib/components/Terminal/Code.svelte @@ -63,7 +63,7 @@ async function handleKeyDown(event: KeyboardEvent) { } onMount(() => { - terminal.setStep(5) + terminal.setStep(7) if (inputElement) { inputElement.focus() } diff --git a/ceremony/src/lib/components/Terminal/Join.svelte b/ceremony/src/lib/components/Terminal/Join.svelte index 08ebc300f9..5cb6ef43e2 100644 --- a/ceremony/src/lib/components/Terminal/Join.svelte +++ b/ceremony/src/lib/components/Terminal/Join.svelte @@ -17,7 +17,7 @@ let selected = $state(false) let code = $state(false) onMount(() => { - terminal.setStep(4) + terminal.setStep(6) terminal.updateHistory({ text: "Access the ceremony", replace: true }) terminal.updateHistory({ text: "We officially support Linux and macOS on Chrome, Firefox, or Brave browsers.", @@ -34,8 +34,8 @@ onMount(() => { replace: true, type: "warning" }) - terminal.setStep(2) }) + onDestroy(() => { terminal.clearHistory() }) diff --git a/ceremony/src/lib/components/Terminal/Missed.svelte b/ceremony/src/lib/components/Terminal/Missed.svelte index 461389ac86..996436d0a0 100644 --- a/ceremony/src/lib/components/Terminal/Missed.svelte +++ b/ceremony/src/lib/components/Terminal/Missed.svelte @@ -7,7 +7,7 @@ import { user } from "$lib/state/session.svelte.ts" const { terminal } = getState() onMount(() => { - terminal.setStep(9) + terminal.setStep(0) terminal.updateHistory({ text: "Too bad, you missed your slot.", replace: true }) axiom.ingest("monitor", [{ user: user.session?.user.id, type: "missed" }]) }) diff --git a/ceremony/src/lib/components/Terminal/Queue.svelte b/ceremony/src/lib/components/Terminal/Queue.svelte index 214e0e1bd2..a6551bd747 100644 --- a/ceremony/src/lib/components/Terminal/Queue.svelte +++ b/ceremony/src/lib/components/Terminal/Queue.svelte @@ -14,7 +14,7 @@ let waitingTime = $state(0) let averages = $state() onMount(async () => { - terminal.setStep(6) + terminal.setStep(8) terminal.updateHistory({ text: "You are in queue" }) axiom.ingest("monitor", [{ user: user.session?.user.id, type: "mount_queue" }]) averages = await getAverageTimes() diff --git a/ceremony/src/lib/components/Terminal/Waitlist.svelte b/ceremony/src/lib/components/Terminal/Waitlist.svelte index 8878c2b372..9a78558ba1 100644 --- a/ceremony/src/lib/components/Terminal/Waitlist.svelte +++ b/ceremony/src/lib/components/Terminal/Waitlist.svelte @@ -9,7 +9,7 @@ import { user } from "$lib/state/session.svelte.ts" const { terminal } = getState() onMount(async () => { - terminal.setStep(5) + terminal.setStep(7) terminal.updateHistory({ text: "You're on the waitlist" }) terminal.updateHistory({ text: `When the ceremony opens to the public, you will get priority in the queue.` diff --git a/ceremony/src/routes/+page.svelte b/ceremony/src/routes/+page.svelte index 1a4bb0a716..f9aa4655e6 100644 --- a/ceremony/src/routes/+page.svelte +++ b/ceremony/src/routes/+page.svelte @@ -50,11 +50,11 @@ onMount(() => { {:else if contributor.state === 'contribute'} - {terminal.setStep(7)} + {terminal.setStep(9)} {terminal.updateHistory({text: "Starting contribution...", replace: true})} {:else if contributor.state === "contributing"} - {terminal.setStep(8)} + {terminal.setStep(9)} {terminal.updateHistory({text: "Contributing...", replace: true})} {:else} From db65eab6ab29d71bbee5f68873a13511413e39bd Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 2 Oct 2024 22:52:57 +0200 Subject: [PATCH 2/2] fix(ceremony): change to position --- ceremony/src/lib/components/Terminal/Queue.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceremony/src/lib/components/Terminal/Queue.svelte b/ceremony/src/lib/components/Terminal/Queue.svelte index a6551bd747..0f2d528367 100644 --- a/ceremony/src/lib/components/Terminal/Queue.svelte +++ b/ceremony/src/lib/components/Terminal/Queue.svelte @@ -26,8 +26,8 @@ onDestroy(() => { }) $effect(() => { - if (averages && contributor.queueState.count) { - waitingTime = (contributor.queueState.count * averages.totalMs) / 1000 / 60 + if (averages && contributor.queueState.position) { + waitingTime = (contributor.queueState.position * averages.totalMs) / 1000 / 60 } })