diff --git a/src/lib/components/Gateways/InviteCode.svelte b/src/lib/components/Gateways/InviteCode.svelte index 170e6f5..af8e57e 100644 --- a/src/lib/components/Gateways/InviteCode.svelte +++ b/src/lib/components/Gateways/InviteCode.svelte @@ -3,6 +3,7 @@ import { alertQueue, configStore } from '$lib/stores'; import { onMount } from 'svelte'; import Loading from '$lib/components/Utils/Loading.svelte'; + import { goto } from '$app/navigation'; export let code = ''; export let buttonText = 'Submit'; export let hideInput = false; @@ -11,20 +12,25 @@ let loading = false; let err: string | undefined; - function addCode(code: string) { + function addCode(code: string): Promise { loading = true; - inviteCode(code) + return inviteCode(code) .then((acceptedRoomNames) => { if (acceptedRoomNames) { acceptedRoomNames = acceptedRoomNames; + return true; + } else { + return false; } }) .catch((err) => { console.warn(err); alertQueue.enqueue(`Unexpected error: ${err.message}`, 'error'); + return false; }) .finally(() => { loading = false; + return false; }); } @@ -82,7 +88,11 @@ } onMount(() => { if (code == $configStore.signUpStatus.inviteCode && code.length >= 7) { - addCode(code); + addCode(code).then((accepted: boolean) => { + if (accepted) { + goto('/chat'); + } + }); } }); diff --git a/src/lib/components/Onboarding/Gateways.svelte b/src/lib/components/Onboarding/Gateways.svelte index f563705..8bc7aeb 100644 --- a/src/lib/components/Onboarding/Gateways.svelte +++ b/src/lib/components/Onboarding/Gateways.svelte @@ -7,6 +7,7 @@ import Card from '$lib/components/Utils/Card.svelte'; import BullHorn from 'svelte-material-icons/Bullhorn.svelte'; import { configStore, numberServers } from '$lib/stores'; + import Button from '../Utils/Button.svelte'; {#if $numberServers > 1} @@ -17,8 +18,12 @@ {/if}
+ class="grid"> + Join via invite code If you were given an invite code, you can @@ -27,13 +32,11 @@ Join Alpha Testers Test things out, let us know if you have any issues + >Test things out, let us know if you have any issues + buttonText="Join Alpha Testers" /> Discord Bot @@ -41,14 +44,12 @@ Invite Discord Bot! + class="btn variant-ghost-primary">Invite Discord Bot! Join via Jubmoji Prove your collection and get access to special rooms + >Prove your collection and get access to special rooms @@ -64,8 +65,7 @@ The Word + >The Word Do you know { goto('/chat'); }} - buttonCompleteLabel="Lets Go Chat Anon" + buttonCompleteLabel="Lets Go Chat Anon ►" buttonNext="variant-filled-success" buttonComplete="variant-filled-success">