diff --git a/src/app/components/IECPage.tsx b/src/app/components/IECPage.tsx index 69008b3..c99cd61 100644 --- a/src/app/components/IECPage.tsx +++ b/src/app/components/IECPage.tsx @@ -24,6 +24,18 @@ export default function IECPage({ config, setConfig }: IECPageProps) { const iec = config.iec || {}; + const boolDirEntries = Object.entries(iec.directory || {}).filter(([, v]) => v === 0 || v === 1); + const isCompatMode = boolDirEntries.length > 0 && boolDirEntries.every(([, v]) => v === 0); + + const setAllDirBools = (val: 0 | 1) => { + const newConfig = JSON.parse(JSON.stringify(config)); + const dir = newConfig.iec?.directory ?? {}; + for (const k of Object.keys(dir)) { + if (dir[k] === 0 || dir[k] === 1) dir[k] = val; + } + setConfig(newConfig); + }; + return (