feat: ota progress bar

fix: can't set settings with inverse/scale
This commit is contained in:
2025-04-22 19:14:51 +02:00
parent 92b52e08f7
commit 5801e5fbbe
4 changed files with 64 additions and 42 deletions

View File

@@ -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;
}