when opening IndependentPanel, if the latest session has been used, automatically create a new session (#601)

This commit is contained in:
josc146
2024-01-26 14:18:44 +08:00
parent bd2522ca64
commit 05a99f337e
+6 -2
View File
@@ -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)
}
})()
}, [])