Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hirenko-v authored Sep 22, 2024
1 parent 987f648 commit 5bc832a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cmd/msg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,16 @@ func showBothSelects(state map[string]string) executor.ExecuteOutput {
state[flagKey] = fmt.Sprintf("%s %s", option.Flags[0], option.Default)
}

var initialOption *api.OptionItem
if option.Default != "" {
initialOption = &api.OptionItem{
Name: option.Default,
Value: fmt.Sprintf("%s %s", option.Flags[0], option.Default),
}
} else {
initialOption = nil // Set to nil if Default is not set
}

// Add the dropdown with the InitialOption if available
sections[0].Selects.Items = append(sections[0].Selects.Items, api.Select{
Name: option.Description, // Adjust name based on flags
Expand All @@ -258,10 +268,7 @@ func showBothSelects(state map[string]string) executor.ExecuteOutput {
Options: dropdownOptions,
},
},
// InitialOption: &api.OptionItem{
// Name: option.Default,
// Value: fmt.Sprintf("%s %s", option.Flags[0], option.Default),
// },
InitialOption: initialOption,
})
}

Expand Down

0 comments on commit 5bc832a

Please sign in to comment.