Skip to content

Commit

Permalink
fix arguments form spawning multiple times when toggling run type
Browse files Browse the repository at this point in the history
  • Loading branch information
MFA-X-AI committed Aug 22, 2024
1 parent 949da78 commit 67dc602
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/components/XircuitsBodyWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -715,16 +715,18 @@ export const BodyWidget: FC<BodyWidgetProps> = ({
} 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();
Expand All @@ -740,9 +742,6 @@ export const BodyWidget: FC<BodyWidgetProps> = ({
}
}
}
else {
Object.values(setterByType).forEach(set => set([]));
}
})
}, [initialize, runType]);

Expand Down

0 comments on commit 67dc602

Please sign in to comment.