diff options
author | Suchita Lad | 2025-06-27 17:34:30 +0530 |
---|---|---|
committer | Suchita Lad | 2025-06-27 17:34:30 +0530 |
commit | 0931999dabde4e938bd376120db8a392dbd2cdf0 (patch) | |
tree | e86d6c55c4df725a9d243457c392252a3e840b88 | |
parent | a9b734168e26f0304c5f021a17f9a7886e82c572 (diff) | |
download | Common-Interface-Project-0931999dabde4e938bd376120db8a392dbd2cdf0.tar.gz Common-Interface-Project-0931999dabde4e938bd376120db8a392dbd2cdf0.tar.bz2 Common-Interface-Project-0931999dabde4e938bd376120db8a392dbd2cdf0.zip |
Removed multiple calls of log
4 files changed, 14 insertions, 11 deletions
diff --git a/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js b/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js index e585f489..6d78dc66 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js @@ -558,12 +558,12 @@ export default function SchematicToolbar ({ _mobileClose, gridRef }) { </Drawer> {/* ✅ Dialogs & Modals */} - <OpenSchDialog open={schOpen} close={handleSchDialClose} openLocal={handleLocalSchOpen} /> - <SimpleSnackbar open={snacOpen} close={handleSnacClose} message={message} /> - <ImageExportDialog open={imgopen} onClose={handleImgClose} /> - <NetlistModal open={open} close={handleClose} netlist={netlist} /> - <HelpScreen open={helpOpen} close={handleHelpClose} /> - <ScriptScreen isOpen={scriptOpen} onClose={handleScriptClose} /> + {schOpen && <OpenSchDialog open={schOpen} close={handleSchDialClose} openLocal={handleLocalSchOpen} /> } + {snacOpen && <SimpleSnackbar open={snacOpen} close={handleSnacClose} message={message} /> } + {imgopen && <ImageExportDialog open={imgopen} onClose={handleImgClose} /> } + {open && <NetlistModal open={open} close={handleClose} netlist={netlist} /> } + {helpOpen && <HelpScreen open={helpOpen} close={handleHelpClose} /> } + {scriptOpen && <ScriptScreen isOpen={scriptOpen} onClose={handleScriptClose} /> } </> ) } diff --git a/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js b/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js index 85809e08..1904edb3 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js @@ -690,7 +690,7 @@ export function OpenSchDialog (props) { const user = useSelector(state => state.auth.user) const schematics = useSelector(state => state.dashboard.schematics) const GallerySchSample = useSelector(state => state.dashboard.gallery) - const xmlData = useSelector(state => state.saveSchematic.xmlData) + const dispatch = useDispatch() @@ -699,10 +699,11 @@ export function OpenSchDialog (props) { }, [dispatch]) useEffect(() => { + const xmlData = store.getState().saveSchematic.xmlData if (xmlData) { renderGalleryXML(xmlData) } - }, [xmlData]) + }, []) const title = 'Open ' + process.env.REACT_APP_DIAGRAM_NAME const typography1 = 'You don\'t have any saved ' + process.env.REACT_APP_SMALL_DIAGRAMS_NAME + '...' diff --git a/blocks/eda-frontend/src/pages/SchematicEditor.js b/blocks/eda-frontend/src/pages/SchematicEditor.js index 857543f8..40c516b4 100644 --- a/blocks/eda-frontend/src/pages/SchematicEditor.js +++ b/blocks/eda-frontend/src/pages/SchematicEditor.js @@ -18,6 +18,7 @@ import { renderGalleryXML, getSuperBlockDiagram } from '../components/SchematicE import '../components/SchematicEditor/Helper/SchematicEditor.css' import { fetchDiagram, fetchSchematic } from '../redux/saveSchematicSlice' import { useDispatch, useSelector } from 'react-redux' +import store from '../redux/store' import { styleToObject } from '../utils/GalleryUtils' import { changePorts } from '../components/SchematicEditor/ComponentProperties' import { graph, getCurrentDiagramXML } from '../components/SchematicEditor/Helper/ComponentDrag' @@ -40,7 +41,6 @@ export default function SchematicEditor (props) { const dispatch = useDispatch() const [mobileOpen, setMobileOpen] = useState(false) const isLoading = useSelector(state => state.saveSchematic.isLoading) - const xmlData = useSelector(state => state.saveSchematic.xmlData) const [mainDiagramBackup, setMainDiagramBackup] = useState('') const [activeCellId, setActiveCellId] = useState(null) @@ -105,10 +105,11 @@ export default function SchematicEditor (props) { useEffect(() => { + const xmlData = store.getState().saveSchematic.xmlData if (xmlData) { renderGalleryXML(xmlData) } - }, [dispatch, xmlData]) + }, []) useEffect(() => { document.title = process.env.REACT_APP_DIAGRAM_NAME + ' Editor - ' + process.env.REACT_APP_NAME diff --git a/blocks/simulationAPI/views.py b/blocks/simulationAPI/views.py index 8b44f3e2..aa41888b 100644 --- a/blocks/simulationAPI/views.py +++ b/blocks/simulationAPI/views.py @@ -113,6 +113,7 @@ class XmlSave(APIView): logger.info('Got POST for Xml save: data=%s', request.data) file = request.FILES.get('file', None) script_task_id = request.POST.get('scriptTaskId', None) + workspace_file = None if not file: return Response({"error": "No file provided"}, status=status.HTTP_400_BAD_REQUEST) file_name = file.name @@ -134,7 +135,7 @@ class XmlSave(APIView): else: print("No scriptTaskId provided") - logger.info('workspace_file: %s', workspace_file) + # logger.info('workspace_file: %s', workspace_file) try: # Update the request data to include the file path data = request.data.copy() |