aboutsummaryrefslogtreecommitdiffstats
path: root/website/src/routes/welcome/+page.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'website/src/routes/welcome/+page.svelte')
-rw-r--r--website/src/routes/welcome/+page.svelte9
1 files changed, 6 insertions, 3 deletions
diff --git a/website/src/routes/welcome/+page.svelte b/website/src/routes/welcome/+page.svelte
index 863b69f..ade0837 100644
--- a/website/src/routes/welcome/+page.svelte
+++ b/website/src/routes/welcome/+page.svelte
@@ -1,6 +1,6 @@
<script lang="ts">
import { enhance } from '$app/forms';
- import type { ActionData } from './$types';
+ import type { ActionData, PageData } from './$types';
type FormFailure = {
errors: { username?: string[]; bio?: string[] };
@@ -8,7 +8,7 @@
};
const domain = 'sellershut.com';
- let { form }: { form: ActionData } = $props();
+ let { form, data }: { form: ActionData; data: PageData } = $props();
const formError = $derived(form && 'errors' in form ? (form as FormFailure) : null);
const errors = $derived(formError?.errors);
@@ -30,6 +30,9 @@
$effect(() => {
if (formError?.data?.username) username = formError.data.username;
if (formError?.data?.bio) bio = formError.data.bio;
+ if (data) {
+ username = data.user.username;
+ }
});
</script>
@@ -128,7 +131,7 @@
id="email"
name="email"
type="email"
- value="email@domain.com"
+ value={data.user.email}
readonly
tabindex="-1"
class="flex-1 cursor-not-allowed border-none bg-transparent py-2.5 pr-4 pl-3 text-sm text-gray-500 outline-none focus:ring-0 md:text-base"