mirror of
https://github.com/Discreetly/frontend.git
synced 2026-01-08 20:38:04 -05:00
20 lines
611 B
Svelte
20 lines
611 B
Svelte
<script lang="ts">
|
|
import { goto } from '$app/navigation';
|
|
import { page } from '$app/stores';
|
|
import { configStore, identityExists } from '$lib/stores';
|
|
import { onMount } from 'svelte';
|
|
|
|
$configStore.signUpStatus.inviteCode = $page.params.invite;
|
|
console.info(`Invited with code: ${$page.params.invite}`);
|
|
|
|
onMount(() => {
|
|
if ($identityExists) {
|
|
console.warn('Invite code saved, routing to /gateways from /signup/[inviteCode]');
|
|
goto('/gateways');
|
|
} else {
|
|
console.warn('Identity not detected, redirecting to signup page from /signup/[inviteCode]');
|
|
goto('/signup');
|
|
}
|
|
});
|
|
</script>
|