Fix error check bug

This commit is contained in:
IamTheFij 2024-10-18 13:26:51 -07:00
parent 71aa5ed835
commit cddd3d69c4

View File

@ -67,10 +67,13 @@ func initialModel(fullscreen bool, colorLeft string, colorRight string) model {
} }
validateInt := func(text string) error { validateInt := func(text string) error {
_, err := strconv.Atoi(text) if _, err := strconv.Atoi(text); err != nil {
return fmt.Errorf("invalid int input: %w", err) return fmt.Errorf("invalid int input: %w", err)
} }
return nil
}
inputs[0].Placeholder = "Interval length (minutes or duration)" inputs[0].Placeholder = "Interval length (minutes or duration)"
inputs[0].Validate = validateDuration inputs[0].Validate = validateDuration
inputs[1].Placeholder = "Break length (minutes or duration)" inputs[1].Placeholder = "Break length (minutes or duration)"