Skip to content

Commit

Permalink
Set up iota to describe steps instead of using ints (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolson authored Apr 3, 2024
1 parent d148bb6 commit ba74393
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/quickstart/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ const (
defaultEnvKey = "test"
)

const (
_ = iota
stepCreateFlag
stepChooseSDK
stepShowSDKInstructions
stepToggleFlag
)

// ContainerModel is a high level container model that controls the nested models wher each
// represents a step in the quick-start flow.
type ContainerModel struct {
Expand Down Expand Up @@ -57,7 +65,7 @@ func (m ContainerModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
cmd = tea.Quit
case key.Matches(msg, keys.Back):
// if showing SDK instructions, let the user go back to choose a different SDK
if m.currentStep == 3 {
if m.currentStep == stepShowSDKInstructions {
m.currentStep -= 1
m.currentModel = NewChooseSDKModel(m.sdk.index)
cmd = m.currentModel.Init()
Expand Down

0 comments on commit ba74393

Please sign in to comment.