Fix error check bug
This commit is contained in:
parent
71aa5ed835
commit
cddd3d69c4
5
main.go
5
main.go
@ -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)"
|
||||||
|
Loading…
Reference in New Issue
Block a user