mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
fix: off-by-one error in spinner example
This commit is contained in:
committed by
Christian Muehlhaeuser
parent
5d1ffa74cd
commit
900a842f50
@@ -55,7 +55,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
return m, tea.Quit
|
return m, tea.Quit
|
||||||
case "h", "left":
|
case "h", "left":
|
||||||
m.index--
|
m.index--
|
||||||
if m.index <= 0 {
|
if m.index < 0 {
|
||||||
m.index = len(spinners) - 1
|
m.index = len(spinners) - 1
|
||||||
}
|
}
|
||||||
m.resetSpinner()
|
m.resetSpinner()
|
||||||
|
|||||||
Reference in New Issue
Block a user