activeStep returns the picker for the current phase, or nil when the wizard is done / in manual-entry mode.
()
| 221 | // activeStep returns the picker for the current phase, or nil when |
| 222 | // the wizard is done / in manual-entry mode. |
| 223 | func (m *launchWizardModel) activeStep() *pickerStep { |
| 224 | switch m.phase { |
| 225 | case phasePickTool: |
| 226 | return &m.toolStep |
| 227 | case phasePickEndpoint: |
| 228 | return &m.endpointStep |
| 229 | case phasePickModel: |
| 230 | if m.manualEntry { |
| 231 | return nil |
| 232 | } |
| 233 | return &m.modelStep |
| 234 | } |
| 235 | return nil |
| 236 | } |
| 237 | |
| 238 | // advanceToNextNeededPhase sets m.phase to the first phase that still |
| 239 | // needs user input. Skipped phases are recorded in m.sel already. |