mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-19 16:32:58 +00:00
feat: ota progress bar
fix: can't set settings with inverse/scale
This commit is contained in:
@@ -49,6 +49,8 @@ export const setting: Action<
|
||||
if (isNumeric) {
|
||||
value = Number(node.value);
|
||||
if (Number.isNaN(value)) return;
|
||||
if (min !== undefined) value = Math.max(min, value);
|
||||
if (max !== undefined) value = Math.min(max, value);
|
||||
value = Math.floor(
|
||||
inverse !== undefined
|
||||
? inverse / value
|
||||
@@ -56,8 +58,6 @@ export const setting: Action<
|
||||
? value / scale
|
||||
: value,
|
||||
);
|
||||
if (min !== undefined) value = Math.max(min, value);
|
||||
if (max !== undefined) value = Math.min(max, value);
|
||||
} else {
|
||||
value = node.checked ? 1 : 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user