mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 07:16:51 +00:00
fix(sns): derive per-user totals from timeline counts map
This commit is contained in:
@@ -497,11 +497,12 @@ export default function SnsPage() {
|
||||
setAuthorTimelineTotalPosts(null)
|
||||
|
||||
try {
|
||||
const result = await window.electronAPI.sns.getUserPostStats(target.username)
|
||||
const result = await window.electronAPI.sns.getUserPostCounts()
|
||||
if (requestToken !== authorTimelineStatsTokenRef.current) return
|
||||
|
||||
if (result.success && result.data) {
|
||||
setAuthorTimelineTotalPosts(Math.max(0, Number(result.data.totalPosts || 0)))
|
||||
if (result.success && result.counts) {
|
||||
const totalPosts = result.counts[target.username] ?? 0
|
||||
setAuthorTimelineTotalPosts(Math.max(0, Number(totalPosts || 0)))
|
||||
} else {
|
||||
setAuthorTimelineTotalPosts(null)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user