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)
}
function startNewChat() {
async function startNewChat() {
newChat()
showHistory.value = false
// Create new session if there's a current session
if (currentSession.value) {
handleNewSession()
// Always create a new session
const newSession = await createSession('未命名搜尋', mode.value)
if (newSession) {
setCurrentSession(newSession)
}
}