(state)
| 39 | * @returns {object|null} |
| 40 | */ |
| 41 | export function selectNextStep(state) { |
| 42 | const steps = currentSteps(state); |
| 43 | if (!steps.length) return null; |
| 44 | const ord = (state && state.ordering) || { activeRank: null }; |
| 45 | const inPhase = steps.find( |
| 46 | (x) => x.status !== "done" && (ord.activeRank == null || x.rank === ord.activeRank) |
| 47 | ); |
| 48 | return inPhase || steps.find((x) => x.status !== "done") || null; |
| 49 | } |
| 50 | |
| 51 | /** Whether the given step is now checked off in a freshly scanned state. */ |
| 52 | export function isStepDone(state, step) { |
no test coverage detected