mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-05 08:29:24 +08:00
when opening IndependentPanel, if the latest session has been used, automatically create a new session (#601)
This commit is contained in:
@@ -50,8 +50,12 @@ function App() {
|
||||
// eslint-disable-next-line
|
||||
;(async () => {
|
||||
const sessions = await getSessions()
|
||||
setSessions(sessions)
|
||||
await setSessionIdSafe(sessions[0].sessionId)
|
||||
if (sessions[0].conversationRecords && sessions[0].conversationRecords.length > 0) {
|
||||
await createNewChat()
|
||||
} else {
|
||||
setSessions(sessions)
|
||||
await setSessionIdSafe(sessions[0].sessionId)
|
||||
}
|
||||
})()
|
||||
}, [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user