mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Make reading speed user-configurable
This commit is contained in:
parent
3a0aaddafd
commit
6e50ce3293
31 changed files with 395 additions and 173 deletions
|
@ -79,6 +79,25 @@ func ValidateUserModification(store *storage.Storage, userID int64, changes *mod
|
|||
}
|
||||
}
|
||||
|
||||
if changes.DefaultReadingSpeed != nil {
|
||||
if err := validateReadingSpeed(*changes.DefaultReadingSpeed); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if changes.CJKReadingSpeed != nil {
|
||||
if err := validateReadingSpeed(*changes.CJKReadingSpeed); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateReadingSpeed(readingSpeed int) *ValidationError {
|
||||
if readingSpeed <= 0 {
|
||||
return NewValidationError("error.settings_reading_speed_is_positive")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue