fix: 单个任务通知也跳转到统一的任务列表页
之前1个任务跳 TaskDetail,多个跳 TaskList,体验不一致 统一都跳 TaskListFragment(单任务时就是全屏展示一个) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user