diff --git a/web/src/App.tsx b/web/src/App.tsx index 8eb0a543..1a038f6c 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -114,7 +114,7 @@ function AppInner() { }, [goBack, pathname]) const queryClient = useQueryClient() const sessionMatch = matchRoute({ to: '/sessions/$sessionId' }) - const selectedSessionId = sessionMatch ? sessionMatch.sessionId : null + const selectedSessionId = sessionMatch && sessionMatch.sessionId !== 'new' ? sessionMatch.sessionId : null const { isSyncing, startSync, endSync } = useSyncingState() const [sseDisconnected, setSseDisconnected] = useState(false) const syncTokenRef = useRef(0) diff --git a/web/src/router.tsx b/web/src/router.tsx index 018f7f83..0dd3ad15 100644 --- a/web/src/router.tsx +++ b/web/src/router.tsx @@ -108,7 +108,7 @@ function SessionsPage() { const projectCount = new Set(sessions.map(s => s.metadata?.worktree?.basePath ?? s.metadata?.path ?? 'Other')).size const sessionMatch = matchRoute({ to: '/sessions/$sessionId', fuzzy: true }) - const selectedSessionId = sessionMatch ? sessionMatch.sessionId : null + const selectedSessionId = sessionMatch && sessionMatch.sessionId !== 'new' ? sessionMatch.sessionId : null const isSessionsIndex = pathname === '/sessions' || pathname === '/sessions/' return (