perf(export): batch message count retrieval for large session lists

This commit is contained in:
tisonhuang
2026-03-01 18:02:51 +08:00
parent a8eb0057e3
commit 5147b3f0e4
6 changed files with 81 additions and 12 deletions

View File

@@ -624,6 +624,10 @@ function ExportPage() {
const count = prev[session.username]
if (typeof count === 'number') {
next[session.username] = count
continue
}
if (typeof session.messageCountHint === 'number' && Number.isFinite(session.messageCountHint) && session.messageCountHint >= 0) {
next[session.username] = Math.floor(session.messageCountHint)
}
}
return next

View File

@@ -7,6 +7,7 @@ export interface ChatSession {
sortTimestamp: number // 用于排序
lastTimestamp: number // 用于显示时间
lastMsgType: number
messageCountHint?: number // 会话总消息数提示(若底层直接可取)
displayName?: string
avatarUrl?: string
lastMsgSender?: string