fix(ui): team builder — coalesce the queued-jump block to null so an empty queue no longer disables JUMP dispatch (#44)
CI / build + unit + e2e (pull_request) Successful in 2m38s

This commit is contained in:
2026-10-03 23:42:32 +00:00
parent 8f018a6ee9
commit e792c8a06c
2 changed files with 8 additions and 3 deletions
+6 -2
View File
@@ -23,9 +23,13 @@ export function TeamBuilder({ type, hopCount, roster, tasks, onQueue }: {
const [helperIds, setHelperIds] = useState<number[]>([])
// Whole-builder blocks: an ACTIVE jump is in transit (all types); in the jump panel any
// queued jump is — the second-jump 409 (JC-12).
// queued jump is — the second-jump 409 (JC-12). The JUMP branch coalesces find()'s
// undefined to null so blocked is strictly QueueDto | null: the roster ternary below tests
// truthiness, but the button guard compares to null — undefined slipped past it and
// disabled every empty-queue JUMP dispatch (v0.10.1 e2e jump regression).
const inTransit = tasks.find((t) => t.type === 'JUMP' && t.status === 'ACTIVE')
const blocked = inTransit ?? (type === 'JUMP' ? tasks.find((t) => t.type === 'JUMP') : null)
const queuedJump = type === 'JUMP' ? (tasks.find((t) => t.type === 'JUMP') ?? null) : null
const blocked = inTransit ?? queuedJump
const lead = roster.find((c) => c.id === leadId) ?? null
const helpers = roster.filter((c) => helperIds.includes(c.id))