Fix DailyLimits passing undefined values into SpinBox

If the type says it's a number, we should ensure it's a number :-)

This also fixes fields being empty when they contain a 0 value.
This commit is contained in:
Damien Elmes 2023-01-28 20:58:04 +10:00
parent d20a7d291f
commit df09e34927
2 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
}
let stringValue: string;
$: if (value) stringValue = value.toFixed(decimalPlaces(step));
$: stringValue = value.toFixed(decimalPlaces(step));
function update(this: HTMLInputElement): void {
const newValue = parseFloat(this.value);

View File

@ -126,8 +126,8 @@
: [],
);
let newValue: number;
let reviewsValue: number;
let newValue = 0;
let reviewsValue = 0;
const settings = {
newLimit: {