* Updates task state in AppState.
( taskId: string, updater: (task: InProcessTeammateTaskState) => InProcessTeammateTaskState, setAppState: SetAppStateFn, )
| 517 | * Updates task state in AppState. |
| 518 | */ |
| 519 | function updateTaskState( |
| 520 | taskId: string, |
| 521 | updater: (task: InProcessTeammateTaskState) => InProcessTeammateTaskState, |
| 522 | setAppState: SetAppStateFn, |
| 523 | ): void { |
| 524 | setAppState(prev => { |
| 525 | const task = prev.tasks[taskId] |
| 526 | if (!task || task.type !== 'in_process_teammate') { |
| 527 | return prev |
| 528 | } |
| 529 | const updated = updater(task) |
| 530 | if (updated === task) { |
| 531 | return prev |
| 532 | } |
| 533 | return { |
| 534 | ...prev, |
| 535 | tasks: { |
| 536 | ...prev.tasks, |
| 537 | [taskId]: updated, |
| 538 | }, |
| 539 | } |
| 540 | }) |
| 541 | } |
| 542 | |
| 543 | /** |
| 544 | * Sends a message to the leader's file-based mailbox. |
no outgoing calls
no test coverage detected