Linting update

This commit is contained in:
IamTheFij 2024-10-18 13:27:19 -07:00
parent cddd3d69c4
commit 5451e54082

View File

@ -49,7 +49,8 @@ type model struct {
}
func initialModel(fullscreen bool, colorLeft string, colorRight string) model {
inputs := make([]textinput.Model, 3)
numInputs := 3
inputs := make([]textinput.Model, numInputs)
// Set up text input models for interval length, break length, and total intervals
for i := range inputs {
@ -120,12 +121,14 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// Move to the next input field
m.focusIndex = (m.focusIndex + 1) % len(m.inputs)
m.updateFocus()
return m, nil
case "shift+tab":
// Move to the previous input field
m.focusIndex = (m.focusIndex - 1 + len(m.inputs)) % len(m.inputs)
m.updateFocus()
return m, nil
case "enter":
@ -188,10 +191,12 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.isFocus = true
m.intervalNum++
m.runCommands(m.onIntervalEnd)
if m.intervalNum > m.intervals {
// All intervals completed
return m, tea.Quit
}
m.remaining = m.remaining + m.focusTime
m.totalTime = m.focusTime
m.state = "Focus"