fix: recover IDB on closing and restore diagram

This commit is contained in:
dayuan.jiang
2026-01-27 12:07:35 +09:00
parent cc6f09615d
commit 8d92474f73
2 changed files with 91 additions and 40 deletions

View File

@@ -581,7 +581,7 @@ export default function ChatPanel({
try {
const currentSession = sessionManager.currentSession
if (currentSession && currentSession.messages.length > 0) {
if (currentSession) {
// Restore from session manager (IndexedDB)
justLoadedSessionRef.current = true
syncUIWithSession(currentSession)
@@ -618,7 +618,7 @@ export default function ChatPanel({
lastSyncedSessionIdRef.current = newSessionId
// Sync UI with new session
if (newSession && newSession.messages.length > 0) {
if (newSession) {
justLoadedSessionRef.current = true
syncUIWithSession(newSession)
} else if (!newSession) {