Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function App() {
const path = window.location.pathname
const hash = window.location.hash.slice(1) // 去掉 #

if (path === '/welcome') return 'traders'
if (path === '/traders' || hash === 'traders') return 'traders'
if (path === '/strategy' || hash === 'strategy') return 'strategy'
if (path === '/strategy-market' || hash === 'strategy-market') return 'strategy-market'
Expand Down Expand Up @@ -157,7 +158,9 @@ function App() {
const params = new URLSearchParams(window.location.search)
const traderParam = params.get('trader')

if (path === '/traders' || hash === 'traders') {
if (path === '/welcome') {
setCurrentPage('traders')
} else if (path === '/traders' || hash === 'traders') {
setCurrentPage('traders')
} else if (path === '/strategy' || hash === 'strategy') {
setCurrentPage('strategy')
Expand Down Expand Up @@ -337,7 +340,9 @@ function App() {

// Set current page based on route for consistent navigation state
useEffect(() => {
if (route === '/competition') {
if (route === '/welcome') {
setCurrentPage('traders')
} else if (route === '/competition') {
setCurrentPage('competition')
} else if (route === '/traders') {
setCurrentPage('traders')
Expand All @@ -346,6 +351,9 @@ function App() {
}
}, [route])

const showBeginnerOnboarding =
route === '/welcome' && (!!user || hasPersistedAuth) && getUserMode() === 'beginner'

// Show loading spinner while checking auth or config
if (isLoading || configLoading) {
return (
Expand Down Expand Up @@ -391,7 +399,6 @@ function App() {
window.location.href = '/traders'
return null
}
return <BeginnerOnboardingPage />
}
if (route === '/faq') {
return (
Expand Down Expand Up @@ -695,6 +702,8 @@ function App() {
onClose={() => setLoginOverlayOpen(false)}
featureName={loginOverlayFeature}
/>

{showBeginnerOnboarding && <BeginnerOnboardingPage />}
</div>
)
}
Expand Down
Loading
Loading