fix: 单个任务通知也跳转到统一的任务列表页

之前1个任务跳 TaskDetail,多个跳 TaskList,体验不一致
统一都跳 TaskListFragment(单任务时就是全屏展示一个)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dongliang
2026-05-07 20:23:51 +09:30
parent 0682c7e5c5
commit 72f07f18f4

View File

@@ -705,16 +705,11 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
val allIds = notificationManager.pendingTaskIds
if (allIds.isEmpty()) return
if (allIds.size == 1) {
val taskId = allIds.first().toLongOrNull() ?: 0L
val bundle = bundleOf("taskId" to taskId)
findNavController().navigate(R.id.action_home_to_taskDetail, bundle)
} else {
val bundle = bundleOf(
"taskIds" to allIds.mapNotNull { it.toLongOrNull() }.toLongArray()
)
findNavController().navigate(R.id.action_home_to_taskList, bundle)
}
// 统一跳转到任务列表页(单个/多个都走同一页面)
val bundle = bundleOf(
"taskIds" to allIds.mapNotNull { it.toLongOrNull() }.toLongArray()
)
findNavController().navigate(R.id.action_home_to_taskList, bundle)
// 清除所有提示场景3点横幅查看全部
activeDotCards.clear()