fix: startNewChat now always creates new session

- Changed startNewChat to async and always create a new session
- No longer depends on currentSession existing
This commit is contained in:
2026-10-27 06:17:35 +08:00
parent 06217bc314
commit 7f31453723

View File

@@ -711,12 +711,13 @@ function newChat() {
localStorage.removeItem(SESSION_STORAGE_KEY) localStorage.removeItem(SESSION_STORAGE_KEY)
} }
function startNewChat() { async function startNewChat() {
newChat() newChat()
showHistory.value = false showHistory.value = false
// Create new session if there's a current session // Always create a new session
if (currentSession.value) { const newSession = await createSession('未命名搜尋', mode.value)
handleNewSession() if (newSession) {
setCurrentSession(newSession)
} }
} }