fix: prevent /sessions/new from matching as dynamic sessionId route (#164)

This commit is contained in:
Mark L
2026-02-07 22:33:08 +08:00
committed by GitHub
parent 857f625ce3
commit 4a59d4896f
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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 (