From ea732fc3866b4beaab8fc4cd2f95df1cac9aa4bb Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Thu, 27 Aug 2026 11:20:53 +0700 Subject: [PATCH] Fix Sasquatch "Learn More" landing on home instead of /onboarding The guide's action buttons used window.location.href = '/onboarding', a hard full-page navigation. In the SPA/native (Capacitor) context this reboots the app at its entry point (home) rather than resolving the client-side route, so tapping "Learn More" dumped users back on the home page. Switched all Sasquatch guide navigation (Learn More, Login to begin, Login to Offer Services / Create a Crew, Start exploring) to React Router's navigate(), which performs proper in-app client-side routing and reliably renders the target page. Co-authored-by: shakespeare.diy --- src/hooks/useSasquatchGuide.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/hooks/useSasquatchGuide.ts b/src/hooks/useSasquatchGuide.ts index 9de9634..37bf6f1 100644 --- a/src/hooks/useSasquatchGuide.ts +++ b/src/hooks/useSasquatchGuide.ts @@ -1,5 +1,5 @@ import { useState, useEffect } from 'react'; -import { useLocation } from 'react-router-dom'; +import { useLocation, useNavigate } from 'react-router-dom'; import { useCurrentUser } from '@/hooks/useCurrentUser'; import type { GuideMessage } from '@/components/SasquatchGuide'; @@ -9,6 +9,7 @@ import type { GuideMessage } from '@/components/SasquatchGuide'; */ export function useSasquatchGuide() { const location = useLocation(); + const navigate = useNavigate(); const { user } = useCurrentUser(); const [currentMessage, setCurrentMessage] = useState(); @@ -35,7 +36,7 @@ export function useSasquatchGuide() { action: { label: 'Learn More', onClick: () => { - window.location.href = '/onboarding'; + navigate('/onboarding'); }, }, enableChat: true, @@ -66,7 +67,7 @@ export function useSasquatchGuide() { label: user ? 'Start exploring' : 'Login to begin', onClick: () => { if (user) { - window.location.href = '/map'; + navigate('/map'); } else { // Scroll to login section const loginSection = document.getElementById('login-section'); @@ -109,7 +110,7 @@ export function useSasquatchGuide() { action: user ? undefined : { label: 'Login to Offer Services', onClick: () => { - window.location.href = '/onboarding'; + navigate('/onboarding'); }, }, enableChat: true, @@ -136,7 +137,7 @@ export function useSasquatchGuide() { action: user ? undefined : { label: 'Login to Create a Crew', onClick: () => { - window.location.href = '/onboarding'; + navigate('/onboarding'); }, }, enableChat: true, @@ -151,7 +152,7 @@ export function useSasquatchGuide() { } setCurrentMessage(message); - }, [location.pathname, user]); + }, [location.pathname, user, navigate]); const dismissCurrentMessage = () => { setCurrentMessage(undefined);