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 d5919e6 commit 987f648
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cmd/msg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type Option struct {
Flags []string `json:"flags"`
Description string `json:"description"`
Values []string `json:"values,omitempty"`
// Default string `json:"default,omitempty"`
Default string `json:"default,omitempty"`
}

type ScriptOutput struct {
Expand Down Expand Up @@ -243,12 +243,10 @@ func showBothSelects(state map[string]string) executor.ExecuteOutput {
// Construct the flag key for the state
flagKey := fmt.Sprintf("%s-%s", state["first"], option.Flags[0])

// // Check if there's an InitialOption and update the state if it’s not already set
// if _, exists := state[flagKey]; !exists && option.Default != "" {
// state[flagKey] = fmt.Sprintf("%s %s", option.Flags[0], option.Default)
// } else if !exists {
// state[flagKey] = "" // Set a default empty state if no default is provided
// }
// Check if there's an InitialOption and update the state if it’s not already set
if _, exists := state[flagKey]; !exists && option.Default != "" {
state[flagKey] = fmt.Sprintf("%s %s", option.Flags[0], option.Default)
}

// Add the dropdown with the InitialOption if available
sections[0].Selects.Items = append(sections[0].Selects.Items, api.Select{
Expand Down

0 comments on commit 987f648

Please sign in to comment.