Fix homepage's Config tab not saving some options

Resolved #211

Bumped v1 version string and rebuilt client asset
This commit is contained in:
Bobby Wibowo 2020-06-22 19:45:42 +07:00
parent 49ec795941
commit 0caa669980
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
4 changed files with 5 additions and 5 deletions

2
dist/js/home.js vendored

File diff suppressed because one or more lines are too long

2
dist/js/home.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1039,11 +1039,11 @@ page.prepareUploadConfig = () => {
value = form.elements[key].value
} else if (config[key].number !== undefined) {
const parsed = parseInt(form.elements[key].value)
if (!isNaN(parsed))
if (!isNaN(parsed) && parsed !== config[key].number.default)
value = Math.min(Math.max(parsed, config[key].number.min), config[key].number.max)
}
if (value !== undefined && config[key].number && value !== config[key].number.default)
if (value !== undefined)
localStorage[lsKeys[key]] = value
else
localStorage.removeItem(lsKeys[key])

View File

@ -1,5 +1,5 @@
{
"1": "1592600474",
"1": "1592829902",
"2": "1589010026",
"3": "1581416390",
"4": "1581416390",