fix: 返回首页时补显示红点
HomeFragment暂停时(在任务详情页等)收到的NewTaskArrived事件会丢失, 返回首页后红点不显示。onResume中检查pendingCount,补刷统计和红点。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -126,6 +126,14 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
|
||||
observePunchState()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
// 从其他页面返回时,检查是否有未读通知需要显示红点
|
||||
if (notificationManager.pendingCount > 0) {
|
||||
fetchStatistics(checkDots = true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
// 清理 Activity 回调,避免泄漏
|
||||
|
||||
Reference in New Issue
Block a user