From 4e48584da64fbb8a2653f32499bac28f0edfd098 Mon Sep 17 00:00:00 2001 From: zhb <50901800+zhbdesign@users.noreply.github.com> Date: Sun, 28 Jun 2026 09:11:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E7=9C=8B=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E5=8F=98=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E6=B6=88=E6=81=AF=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=9C=88=E6=97=A5=E6=97=B6=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复查看更新更新时间变化,消息时间显示月日时分 --- desktop/src/stores/sessionStore.ts | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/desktop/src/stores/sessionStore.ts b/desktop/src/stores/sessionStore.ts index 439ec0d0..ceeaaf82 100644 --- a/desktop/src/stores/sessionStore.ts +++ b/desktop/src/stores/sessionStore.ts @@ -244,10 +244,9 @@ function mergeSessionList( for (const item of incoming) { const current = currentById.get(item.id) const candidate = preserveLocalTitle(current, item) - const merged = preserveStaleModifiedAt(current, candidate) - const existing = byId.get(merged.id) - if (!existing || sessionModifiedTime(merged) > sessionModifiedTime(existing)) { - byId.set(merged.id, merged) + const existing = byId.get(candidate.id) + if (!existing || sessionModifiedTime(candidate) > sessionModifiedTime(existing)) { + byId.set(candidate.id, candidate) } } @@ -270,21 +269,6 @@ function preserveLocalTitle( return incoming } -function preserveStaleModifiedAt( - current: SessionListItem | undefined, - incoming: SessionListItem, -): SessionListItem { - if (!current) return incoming - // Preserve modifiedAt when the effective title hasn't changed — indicates no meaningful - // content change. messageCount is NOT used here because listSessions always returns 0 - // (a placeholder for performance), while fetchSessionSummary returns the real count, - // so comparing them would always fail and defeat the preservation logic. - if (current.title === incoming.title) { - return { ...incoming, modifiedAt: current.modifiedAt } - } - return incoming -} - function syncOpenSessionTabTitles(sessions: SessionListItem[]): void { const titleById = new Map(sessions.map((session) => [session.id, session.title])) const { tabs, updateTabTitle } = useTabStore.getState()