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 [softwareOpts, setSoftwareOpts] = useState<Option[]>([]);
|
||||
|
||||
// Load laser software list once (independent of rig type)
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
try {
|
||||
const swJson = await apiJson<any>(`/api/options/laser_software`);
|
||||
const sw = Array.isArray(swJson?.data) ? swJson.data : Array.isArray(swJson) ? swJson : [];
|
||||
setSoftwareOpts(sw);
|
||||
} catch (e) { if (!handleAuthError(e)) {
|
||||
console.error('[laser_software] load failed:', e);
|
||||
setSoftwareOpts([]);
|
||||
}
|
||||
})();
|
||||
}, []);
|
||||
const [scanLensOpts, setScanLensOpts] = useState<Option[]>([]);
|
||||
const [focusLensOpts, setFocusLensOpts] = useState<Option[]>([]);
|
||||
// Load laser software list once (independent of rig type)
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
try {
|
||||
const swJson = await apiJson<any>(`/api/options/laser_software`);
|
||||
const sw =
|
||||
Array.isArray(swJson?.data) ? swJson.data :
|
||||
Array.isArray(swJson) ? swJson : [];
|
||||
setSoftwareOpts(sw);
|
||||
} catch (e: any) {
|
||||
if (!handleAuthError(e)) {
|
||||
console.error('[laser_software] load failed:', e);
|
||||
setSoftwareOpts([]);
|
||||
}
|
||||
}
|
||||
})();
|
||||
}, []);
|
||||
|
||||
|
||||
// Form
|
||||
const {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue