fix(coding): rehydrate selected conversation on foreground

This commit is contained in:
inman
2026-09-03 10:45:12 +08:00
parent 301c1496b0
commit 7aa118b2d3
6 changed files with 437 additions and 20 deletions

View File

@@ -511,14 +511,12 @@ export function createCodingConversationStore(
};
});
const entry = get().entriesByConversationId[conversationId];
const snapshotFlight = !entry?.reducer.snapshot
|| entry.reducer.invalidation
|| entry.loadState !== 'live'
? get().loadSnapshot(
conversationId,
entry?.reducer.invalidation ? 'recovering' : 'loading',
)
: Promise.resolve(entry.reducer.snapshot);
const refreshMode = entry?.reducer.invalidation
? 'recovering'
: entry?.reducer.snapshot && entry.loadState === 'live'
? 'silent'
: 'loading';
const snapshotFlight = get().loadSnapshot(conversationId, refreshMode);
await Promise.all([snapshotFlight, get().connectEvents()]);
},