fix: improve session initialization flow
- Fixed onMounted to properly set currentSession after creating default - Ensure loadSessions is called after createSession to refresh list
This commit is contained in:
@@ -607,12 +607,12 @@ onMounted(async () => {
|
|||||||
|
|
||||||
// Auto-create default session if none exists
|
// Auto-create default session if none exists
|
||||||
if (!sessionList.value.length) {
|
if (!sessionList.value.length) {
|
||||||
const defaultSession = await createSession('Default', 'keyword')
|
const newSession = await createSession('Default', 'keyword')
|
||||||
if (defaultSession) {
|
if (newSession) {
|
||||||
setCurrentSession(defaultSession)
|
setCurrentSession(newSession)
|
||||||
|
await loadSessions()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await loadSessions()
|
|
||||||
// Set first session as current
|
// Set first session as current
|
||||||
if (sessionList.value.length && !currentSession.value) {
|
if (sessionList.value.length && !currentSession.value) {
|
||||||
setCurrentSession(sessionList.value[0])
|
setCurrentSession(sessionList.value[0])
|
||||||
|
|||||||
Reference in New Issue
Block a user