From db80b7541a0e24eeaaba30f183835c4e6cf4db91 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 14 Dec 2020 14:53:37 +0100 Subject: [PATCH] Fix mediatag size in settings --- www/settings/inner.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/www/settings/inner.js b/www/settings/inner.js index b4668efff..b4290becb 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -593,8 +593,8 @@ define([ var todo = function () { var val = parseInt($input.val()); + if (typeof(val) !== 'number' || isNaN(val)) { return UI.warn(Messages.error); } if (val === oldVal) { return; } - if (typeof(val) !== 'number') { return UI.warn(Messages.error); } spinner.spin(); common.setAttribute(['general', 'mediatag-size'], val, function (err) { if (err) { @@ -602,6 +602,7 @@ define([ console.error(err); return UI.warn(Messages.error); } + oldVal = val; spinner.done(); UI.log(Messages.saved); }); @@ -616,7 +617,7 @@ define([ common.getAttribute(['general', 'mediatag-size'], function(e, val) { if (e) { return void console.error(e); } - if (typeof(val) !== 'number') { + if (typeof(val) !== 'number' || isNaN(val)) { oldVal = 5; $input.val(5); } else {