mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-05-20 15:10:48 +00:00
修复:足迹页面分段失效的问题;#972 #974 所提到的问题;数据库备份中目录错误的问题;
优化:足迹页面的索引扫描性能;导出页面的消息缓存逻辑
This commit is contained in:
@@ -4364,7 +4364,7 @@ function ExportPage() {
|
||||
try {
|
||||
if (prioritizedSessionIds.length > 0) {
|
||||
patchSessionLoadTraceStage(prioritizedSessionIds, 'messageCount', 'loading')
|
||||
const priorityResult = await window.electronAPI.chat.getSessionMessageCounts(prioritizedSessionIds)
|
||||
const priorityResult = await window.electronAPI.chat.getSessionMessageCounts(prioritizedSessionIds, { bypassSessionCache: true, preferHintCache: false })
|
||||
if (isStale()) return { ...accumulatedCounts }
|
||||
if (priorityResult.success) {
|
||||
applyCounts(priorityResult.counts)
|
||||
@@ -4381,7 +4381,7 @@ function ExportPage() {
|
||||
|
||||
if (remainingSessionIds.length > 0) {
|
||||
patchSessionLoadTraceStage(remainingSessionIds, 'messageCount', 'loading')
|
||||
const remainingResult = await window.electronAPI.chat.getSessionMessageCounts(remainingSessionIds)
|
||||
const remainingResult = await window.electronAPI.chat.getSessionMessageCounts(remainingSessionIds, { bypassSessionCache: true, preferHintCache: false })
|
||||
if (isStale()) return { ...accumulatedCounts }
|
||||
if (remainingResult.success) {
|
||||
applyCounts(remainingResult.counts)
|
||||
@@ -7613,12 +7613,29 @@ function ExportPage() {
|
||||
scheduleSessionMutualFriendsWorker()
|
||||
}
|
||||
|
||||
// 记录刷新前的会话时间戳
|
||||
const oldTimestamps = new Map(
|
||||
sessionsRef.current.map(s => [s.username, s.lastTimestamp || s.sortTimestamp || 0])
|
||||
)
|
||||
|
||||
await Promise.all([
|
||||
loadContactsList({ scopeKey }),
|
||||
loadSnsStats({ full: true }),
|
||||
loadSnsUserPostCounts({ force: true })
|
||||
])
|
||||
|
||||
// 找出有变动的会话(最后消息时间变化)
|
||||
const changedSessions = sessionsRef.current.filter(session => {
|
||||
const oldTs = oldTimestamps.get(session.username) || 0
|
||||
const newTs = session.lastTimestamp || session.sortTimestamp || 0
|
||||
return newTs > oldTs
|
||||
})
|
||||
|
||||
// 只对有变动的会话重新加载消息数量
|
||||
if (changedSessions.length > 0) {
|
||||
await loadSessionMessageCounts(changedSessions, activeTabRef.current, { scopeKey })
|
||||
}
|
||||
|
||||
const currentDetailSessionId = showSessionDetailPanel
|
||||
? String(sessionDetail?.wxid || '').trim()
|
||||
: ''
|
||||
|
||||
@@ -770,12 +770,12 @@ function MyFootprintPage() {
|
||||
<>
|
||||
<section className="kpi-grid">
|
||||
<button type="button" className="kpi-card" onClick={() => setTimelineMode('private')}>
|
||||
<span className="kpi-label">有聊天的人数</span>
|
||||
<span className="kpi-label">收到消息的人数</span>
|
||||
<strong>{data.summary.private_inbound_people}</strong>
|
||||
<small>回复了其中 {data.summary.private_replied_people} 人</small>
|
||||
</button>
|
||||
<button type="button" className="kpi-card" onClick={() => setTimelineMode('private')}>
|
||||
<span className="kpi-label">我有回复的人数</span>
|
||||
<span className="kpi-label">发送消息的人数</span>
|
||||
<strong>{data.summary.private_outbound_people}</strong>
|
||||
<small>回复率 {formatPercent(data.summary.private_reply_rate)}</small>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user