Skip to content

Commit

Permalink
when opening IndependentPanel, if the latest session has been used, a…
Browse files Browse the repository at this point in the history
…utomatically create a new session (#601)
  • Loading branch information
josStorer committed Jan 26, 2024
1 parent bd2522c commit 05a99f3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/IndependentPanel/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})()
}, [])

Expand Down

0 comments on commit 05a99f3

Please sign in to comment.