From 8ac80212b90ba605462ac75b02fd91023b1854ac Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sun, 5 Oct 2025 04:14:53 +0000 Subject: [PATCH] Replace hard reload fallback with react-router fallback cgen-a5fd044f37fb4a7d90472252ee961e23 --- client/pages/Onboarding.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/client/pages/Onboarding.tsx b/client/pages/Onboarding.tsx index c53ca1aa..ed38cecc 100644 --- a/client/pages/Onboarding.tsx +++ b/client/pages/Onboarding.tsx @@ -394,13 +394,16 @@ export default function Onboarding() { description: "Profile setup complete. Welcome to your dashboard.", }); - // Navigate after success (with hard redirect fallback) + // Navigate after success (with lightweight fallback) navigate("/dashboard", { replace: true }); - setTimeout(() => { - if (location.pathname.includes("onboarding")) { - window.location.replace("/dashboard"); - } - }, 400); + + if (typeof window !== "undefined") { + setTimeout(() => { + if (window.location.pathname.includes("onboarding")) { + navigate("/dashboard", { replace: true }); + } + }, 300); + } } catch (e) { function formatError(err: any) { if (!err) return "Unknown error";