settings overhaul and reset
This commit is contained in:
parent
ee055b4060
commit
43c86c3ebc
1 changed files with 4 additions and 4 deletions
|
|
@ -92,14 +92,14 @@ export default function SettingsSubmit({ mode = "create", submissionId, initialV
|
||||||
url = `${API}/items/laser_software?fields=id,name&limit=1000&sort=name`;
|
url = `${API}/items/laser_software?fields=id,name&limit=1000&sort=name`;
|
||||||
} else if (path === "laser_source_co2_galvo") {
|
} else if (path === "laser_source_co2_galvo") {
|
||||||
url = `${API}/items/laser_source?fields=submission_id,make,model,nm&limit=2000&sort=make,model`;
|
url = `${API}/items/laser_source?fields=submission_id,make,model,nm&limit=2000&sort=make,model`;
|
||||||
// Patched: robust numeric parsing to avoid JSX/Element inference and ensure number comparisons
|
// Explicitly reference the global Number to avoid the local <Number/> component shadowing it.
|
||||||
type Row = { submission_id?: string | number; make?: string; model?: string; nm?: string | number | null };
|
type Row = { submission_id?: string | number; make?: string; model?: string; nm?: string | number | null };
|
||||||
const toNum = (v: unknown): number | null => {
|
const toNum = (v: unknown): number | null => {
|
||||||
if (typeof v === "number") return Number.isFinite(v) ? v : null;
|
if (typeof v === "number") return globalThis.Number.isFinite(v) ? v : null;
|
||||||
if (typeof v === "string") {
|
if (typeof v === "string") {
|
||||||
const m = v.match(/-?\d+(\.\d+)?/);
|
const m = v.match(/-?\d+(\.\d+)?/);
|
||||||
const n = m ? Number(m[0]) : NaN;
|
const n = m ? globalThis.Number(m[0]) : NaN;
|
||||||
return Number.isFinite(n) ? n : null;
|
return globalThis.Number.isFinite(n) ? n : null;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue