()
| 216 | * Hides the list after 5 seconds if there are no open tasks. |
| 217 | */ |
| 218 | export function useTasksV2(): Task[] | undefined { |
| 219 | const teamContext = useAppState(s => s.teamContext) |
| 220 | |
| 221 | const enabled = isTodoV2Enabled() && (!teamContext || isTeamLead(teamContext)) |
| 222 | |
| 223 | const store = enabled ? getStore() : null |
| 224 | |
| 225 | return useSyncExternalStore( |
| 226 | store ? store.subscribe : NOOP_SUBSCRIBE, |
| 227 | store ? store.getSnapshot : NOOP_SNAPSHOT, |
| 228 | ) |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * Same as useTasksV2, plus collapses the expanded task view when the list |
no test coverage detected