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:
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user