feat: add ChatEmptyState component and integrate it into ChatMessageList for improved user experience

This commit is contained in:
duanshuwen
2026-04-21 20:57:03 +08:00
parent a259907d12
commit 41c1949a2e
8 changed files with 172 additions and 34 deletions

View File

@@ -675,6 +675,7 @@ async function deleteSession(sessionKey: string): Promise<void> {
if (state.currentSessionKey === sessionKey) {
const nextSession = remaining[0]?.key ?? getDefaultMainSessionKey();
const hasRemainingSessions = remaining.length > 0;
patchState({
...basePatch,
currentSessionKey: nextSession,
@@ -688,7 +689,7 @@ async function deleteSession(sessionKey: string): Promise<void> {
lastUserMessageAt: null,
});
if (nextSession) {
if (hasRemainingSessions && nextSession) {
await loadHistory(nextSession);
}
return;