more rigbuilder fixes
This commit is contained in:
parent
f334bcba73
commit
7cc6764847
1 changed files with 18 additions and 15 deletions
|
|
@ -113,21 +113,24 @@ export default function RigBuilderClient() {
|
||||||
const [sourceOpts, setSourceOpts] = useState<Option[]>([]);
|
const [sourceOpts, setSourceOpts] = useState<Option[]>([]);
|
||||||
const [softwareOpts, setSoftwareOpts] = useState<Option[]>([]);
|
const [softwareOpts, setSoftwareOpts] = useState<Option[]>([]);
|
||||||
|
|
||||||
// Load laser software list once (independent of rig type)
|
// Load laser software list once (independent of rig type)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const swJson = await apiJson<any>(`/api/options/laser_software`);
|
const swJson = await apiJson<any>(`/api/options/laser_software`);
|
||||||
const sw = Array.isArray(swJson?.data) ? swJson.data : Array.isArray(swJson) ? swJson : [];
|
const sw =
|
||||||
setSoftwareOpts(sw);
|
Array.isArray(swJson?.data) ? swJson.data :
|
||||||
} catch (e) { if (!handleAuthError(e)) {
|
Array.isArray(swJson) ? swJson : [];
|
||||||
console.error('[laser_software] load failed:', e);
|
setSoftwareOpts(sw);
|
||||||
setSoftwareOpts([]);
|
} catch (e: any) {
|
||||||
}
|
if (!handleAuthError(e)) {
|
||||||
})();
|
console.error('[laser_software] load failed:', e);
|
||||||
}, []);
|
setSoftwareOpts([]);
|
||||||
const [scanLensOpts, setScanLensOpts] = useState<Option[]>([]);
|
}
|
||||||
const [focusLensOpts, setFocusLensOpts] = useState<Option[]>([]);
|
}
|
||||||
|
})();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
// Form
|
// Form
|
||||||
const {
|
const {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue