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