fix: loadSessions variable shadowing bug

- Local variable 'sessions' was shadowing the ref 'sessions'
- sessions.value = sessions was not updating the ref
- Renamed local variable to 'sessionList' and properly assign to sessions.value
- This fixes sessions not appearing in history list after save
This commit is contained in:
2026-10-27 17:25:19 +08:00
parent 69b83e212b
commit ae2f59b829
2 changed files with 9 additions and 5 deletions

View File

@@ -765,7 +765,9 @@ async function saveCurrentSession() {
// Show rename dialog for session name
if (currentSession.value) {
renamingSession.value = currentSession.value
// Ensure we're working with the session from the list
const sessionFromList = sessionList.value.find(s => s.id === currentSession.value!.id)
renamingSession.value = sessionFromList || currentSession.value
renameValue.value = currentSession.value.title === '未命名' ? '' : currentSession.value.title
nextTick(() => renameInputEl.value?.focus())
}