(msg tea.KeyMsg)
| 446 | } |
| 447 | |
| 448 | func (m *installWizardModel) updateModelStep(msg tea.KeyMsg) (tea.Model, tea.Cmd) { |
| 449 | switch msg.String() { |
| 450 | case "esc": |
| 451 | m.errText = "" |
| 452 | m.step = installWizardStepProvider |
| 453 | return m, nil |
| 454 | case installWizardEnterKey: |
| 455 | if strings.TrimSpace(m.modelInput.Value()) == "" && m.modelRequired() { |
| 456 | m.errText = "model is required" |
| 457 | return m, nil |
| 458 | } |
| 459 | m.errText = "" |
| 460 | m.step = installWizardStepConfirm |
| 461 | return m, nil |
| 462 | } |
| 463 | |
| 464 | var cmd tea.Cmd |
| 465 | m.modelInput, cmd = m.modelInput.Update(msg) |
| 466 | return m, cmd |
| 467 | } |
| 468 | |
| 469 | func (m *installWizardModel) modelRequired() bool { |
| 470 | return m.input.ModelRequired[strings.TrimSpace(m.provider)] |
no test coverage detected