fix: off-by-one error in spinner example

This commit is contained in:
Scott Leggett
2022-09-21 14:34:02 +08:00
committed by Christian Muehlhaeuser
parent 5d1ffa74cd
commit 900a842f50

View File

@@ -55,7 +55,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, tea.Quit
case "h", "left":
m.index--
if m.index <= 0 {
if m.index < 0 {
m.index = len(spinners) - 1
}
m.resetSpinner()