mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 00:42:25 -05:00
[bugfix] more robust list timeline invalidation (#1995)
This commit is contained in:
parent
346ecabd07
commit
f4319740ab
15 changed files with 254 additions and 226 deletions
|
|
@ -73,7 +73,14 @@ func requiredError(key string) gtserror.WithCode {
|
|||
*/
|
||||
|
||||
func ParseLimit(value string, defaultValue int, max, min int) (int, gtserror.WithCode) {
|
||||
return parseInt(value, defaultValue, max, min, LimitKey)
|
||||
i, err := parseInt(value, defaultValue, max, min, LimitKey)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
} else if i == 0 {
|
||||
// treat 0 as an empty query
|
||||
return defaultValue, nil
|
||||
}
|
||||
return i, nil
|
||||
}
|
||||
|
||||
func ParseLocal(value string, defaultValue bool) (bool, gtserror.WithCode) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue