From 3d4b23c53f203249b1d0c8e51d668f7b86dbaa6c Mon Sep 17 00:00:00 2001
From: rtkay123 <dev@kanjala.com>
Date: Sun, 22 Feb 2026 15:18:34 +0200
Subject: feat: prefill welcome step

---
 website/src/routes/welcome/+page.svelte | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'website/src/routes/welcome/+page.svelte')

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"
-- 
cgit v1.2.3

