Skip to content

Commit

Permalink
fix ui
Browse files Browse the repository at this point in the history
Signed-off-by: Horiodino <[email protected]>
  • Loading branch information
Horiodino committed Jun 10, 2024
1 parent fa43c8a commit 6a7307f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cmd/search/constraints.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ func (m *versionConstraintsModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
case key.Matches(msg, KeyMap.Back):
return m.pkgoption.Update(msg)
case key.Matches(msg, KeyMap.Space):

case key.Matches(msg, KeyMap.Enter):
if m.constraint[m.choices[m.cursor]] {
m.constraint[m.choices[m.cursor]] = false
} else {
Expand All @@ -80,8 +81,6 @@ func (m *versionConstraintsModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
m.constraint[m.choices[m.cursor]] = true
}

case key.Matches(msg, KeyMap.Enter):
return m.updateVersionConstraint()
}
}
Expand All @@ -95,9 +94,7 @@ func (m versionConstraintsModel) View() string {
s.WriteString(styles.TitleStyle.Render(fmt.Sprintf("What type of updates would you like for %s-%s?", m.name, m.version)))
s.WriteString("\n\n")
for i, choice := range m.choices {
if m.constraint[choice] {
s.WriteString(styles.SelectedOptionStyle.Render("✔ " + choice))
} else if m.cursor == i {
if m.cursor == i {
s.WriteString(styles.CursorOptionStyle.Render("-> " + choice))
} else {
s.WriteString(styles.OptionStyle.Render(" " + choice))
Expand Down

0 comments on commit 6a7307f

Please sign in to comment.