diff --git a/src/components/XircuitsBodyWidget.tsx b/src/components/XircuitsBodyWidget.tsx index 199f4edb..0a4905fd 100644 --- a/src/components/XircuitsBodyWidget.tsx +++ b/src/components/XircuitsBodyWidget.tsx @@ -715,16 +715,18 @@ export const BodyWidget: FC = ({ } else { setRunConfigs("") } + + const setterByType = { + 'string': setStringNodes, + 'int': setIntNodes, + 'float': setFloatNodes, + 'boolean': setBoolNodes, + 'any': setAnyNodes + } - context.ready.then(() => { - const setterByType = { - 'string': setStringNodes, - 'int': setIntNodes, - 'float': setFloatNodes, - 'boolean': setBoolNodes, - 'any': setAnyNodes - } + Object.values(setterByType).forEach(set => set([])); + context.ready.then(() => { if (initialize) { let allNodes = xircuitsApp.getDiagramEngine().getModel().getNodes(); @@ -740,9 +742,6 @@ export const BodyWidget: FC = ({ } } } - else { - Object.values(setterByType).forEach(set => set([])); - } }) }, [initialize, runType]);