Replace hard reload fallback with react-router fallback

cgen-a5fd044f37fb4a7d90472252ee961e23
This commit is contained in:
Builder.io 2025-10-05 04:14:53 +00:00
parent 81735090ca
commit 8ac80212b9

View file

@ -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";