fix: onResume红点改为直接显示,不依赖diffStats

问题:onViewCreated先于onResume执行,fetchStatistics已将
lastStats更新为新值,onResume的diffStats对比不出差异→无红点。

修复:pendingCount>0时直接显示所有红点,不走diffStats对比。
已确定有新任务,不需要再对比哪个卡片变了。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dongliang
2026-04-29 16:19:34 +09:30
parent 2fd8b7f80d
commit 463ff1373d

View File

@@ -128,9 +128,12 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
override fun onResume() {
super.onResume()
// 从其他页面返回时,检查是否有未读通知需要显示红点
// 从其他页面返回时,有未读通知 → 直接显示红点(不靠 diffStats
// 原因onViewCreated 的 fetchStatistics 已更新 lastStatsdiffStats 对比不出差异
if (notificationManager.pendingCount > 0) {
fetchStatistics(checkDots = true)
dotPool.visibility = View.VISIBLE
dotPunch.visibility = View.VISIBLE
dotComplete.visibility = View.VISIBLE
}
}