mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Restrict the values of rcountmax to the range 0-10
Currently the user can enter any value like -10 and it is accepted and saved in the settings file(s).
This commit is contained in:
@@ -2490,7 +2490,7 @@ function UniReader:addAllCommands()
|
||||
if pcall(function () count = count + 0 end) then
|
||||
-- restrict self.rcountmax in reasonable range
|
||||
self.rcountmax = math.max(count, 0)
|
||||
self.rcountmax = math.min(count, 10)
|
||||
self.rcountmax = math.min(self.rcountmax, 10)
|
||||
-- storing this parameter in both global and local settings
|
||||
G_reader_settings:saveSetting("rcountmax", self.rcountmax)
|
||||
self.settings:saveSetting("rcountmax", self.rcountmax)
|
||||
|
||||
Reference in New Issue
Block a user