diff options
author | Sunil Shetye | 2025-06-05 11:31:37 +0530 |
---|---|---|
committer | Sunil Shetye | 2025-06-05 11:31:37 +0530 |
commit | 2370825caa883b2f8147cf8fe6d08177d285a1f2 (patch) | |
tree | 2d50c2c4b869384fbf2c606ef918c65cf0fb2f44 | |
parent | 685d9035d1619eae502a4b610d7415ccfb34c544 (diff) | |
download | Common-Interface-Project-2370825caa883b2f8147cf8fe6d08177d285a1f2.tar.gz Common-Interface-Project-2370825caa883b2f8147cf8fe6d08177d285a1f2.tar.bz2 Common-Interface-Project-2370825caa883b2f8147cf8fe6d08177d285a1f2.zip |
fix dependencies
12 files changed, 26 insertions, 26 deletions
diff --git a/blocks/eda-frontend/src/App.js b/blocks/eda-frontend/src/App.js index c35427ef..1407d274 100644 --- a/blocks/eda-frontend/src/App.js +++ b/blocks/eda-frontend/src/App.js @@ -23,7 +23,7 @@ const PrivateRoute = ({ component: Component, ...rest }) => { const isLoading = useSelector(state => state.auth.isLoading) const dispatch = useDispatch() - useEffect(() => dispatch(loadUser()), []) + useEffect(() => dispatch(loadUser()), [dispatch]) return ( <Route @@ -50,7 +50,7 @@ const PublicRoute = ({ component: Component, restricted, nav, ...rest }) => { const isLoading = useSelector(state => state.auth.isLoading) const dispatch = useDispatch() - useEffect(() => dispatch(loadUser()), []) + useEffect(() => dispatch(loadUser()), [dispatch]) return ( <Route diff --git a/blocks/eda-frontend/src/components/Dashboard/DashboardSidebar.js b/blocks/eda-frontend/src/components/Dashboard/DashboardSidebar.js index f89cf1de..5a81905f 100644 --- a/blocks/eda-frontend/src/components/Dashboard/DashboardSidebar.js +++ b/blocks/eda-frontend/src/components/Dashboard/DashboardSidebar.js @@ -47,7 +47,7 @@ export default function DashSidebar (_props) { // For Fetching Saved Schematics useEffect(() => { dispatch(fetchSchematics()) - }, []) + }, [dispatch]) const button = 'My ' + process.env.REACT_APP_DIAGRAMS_NAME const placeholder = 'Find your ' + process.env.REACT_APP_SMALL_DIAGRAM_NAME + '...' diff --git a/blocks/eda-frontend/src/components/Dashboard/ProgressPanel.js b/blocks/eda-frontend/src/components/Dashboard/ProgressPanel.js index 32880a89..e7830400 100644 --- a/blocks/eda-frontend/src/components/Dashboard/ProgressPanel.js +++ b/blocks/eda-frontend/src/components/Dashboard/ProgressPanel.js @@ -63,7 +63,7 @@ export default function ProgressPanel () { // For Fetching Saved Schematics useEffect(() => { dispatch(fetchSchematics()) - }, []) + }, [dispatch]) const tab = 'Recent ' + process.env.REACT_APP_DIAGRAMS_NAME const typography = 'You have not created any ' + process.env.REACT_APP_SMALL_DIAGRAM_NAME diff --git a/blocks/eda-frontend/src/components/Dashboard/SchematicsList.js b/blocks/eda-frontend/src/components/Dashboard/SchematicsList.js index 4ee5d0d6..e0c8ea40 100644 --- a/blocks/eda-frontend/src/components/Dashboard/SchematicsList.js +++ b/blocks/eda-frontend/src/components/Dashboard/SchematicsList.js @@ -63,7 +63,7 @@ export default function SchematicsList () { // For Fetching Saved Schematics useEffect(() => { dispatch(fetchSchematics()) - }, []) + }, [dispatch]) const typography1 = 'You don\'t have any saved ' + process.env.REACT_APP_SMALL_DIAGRAMS_NAME + '...' return ( diff --git a/blocks/eda-frontend/src/components/SchematicEditor/ComponentSidebar.js b/blocks/eda-frontend/src/components/SchematicEditor/ComponentSidebar.js index 0f857cc2..16ffe2b7 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/ComponentSidebar.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/ComponentSidebar.js @@ -103,7 +103,7 @@ export default function ComponentSidebar ({ _compRef }) { // For Fetching Libraries useEffect(() => { dispatch(fetchLibraries()) - }, []) + }, [dispatch]) // Used to chunk array const chunk = (array, size) => { @@ -246,7 +246,7 @@ export function ComponentImages () { // For Fetching Image Paths useEffect(() => { dispatch(fetchComponentImages()) - }, []) + }, [dispatch]) return ( <div> diff --git a/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js b/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js index 45aef6f9..e233b0e7 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js @@ -607,7 +607,7 @@ export default function SimulationScreen ({ open, close }) { sse.close() sse = null }, false) - }, [taskId, chartIdList]) + }, [dispatch, taskId, chartIdList]) // Get the simulation result with task_Id const simulationResult = useCallback((url, streamingUrl, timeout) => { @@ -671,7 +671,7 @@ export default function SimulationScreen ({ open, close }) { const getStreamingUrl = 'simulation/streaming/' + taskId simulationResult(getUrl, getStreamingUrl, 2000) - }, [isResult, simulationResult]) + }, [dispatch, isResult, simulationResult]) useEffect(() => getSimulationResult(taskId), [taskId, getSimulationResult]) @@ -681,7 +681,7 @@ export default function SimulationScreen ({ open, close }) { Highcharts.charts[i].reflow() } } - }, [chartIdCount.current]) + }, []) useEffect(() => { const handleTabClose = (event) => { diff --git a/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js b/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js index f5c8ce43..ecc4a1cf 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js @@ -1,4 +1,4 @@ -import { forwardRef, useState, useEffect } from 'react' +import { forwardRef, useCallback, useState, useEffect } from 'react' import PropTypes from 'prop-types' import { AppBar, @@ -372,19 +372,19 @@ export function ScriptScreen ({ isOpen, onClose }) { return () => clearTimeout(timer) } - }, [fetchComplete]) + }, [executeScript, fetchComplete]) - const prepareScriptNetlist = (scriptDump) => { + const prepareScriptNetlist = useCallback((scriptDump) => { const titleA = sanitizeTitle(title) const myblob = new Blob([scriptDump], { type: 'text/plain' }) const file = new File([myblob], `${titleA}.sce`, { type: 'text/sce', lastModified: Date.now() }) const type = 'SCRIPT' - sendSriptNetlist(file, type) - } + sendScriptNetlist(file, type) + }, [sendScriptNetlist, title]) - function sendSriptNetlist (file, type) { + const sendScriptNetlist = useCallback((file, type) => { netlistConfig(file, type) .then((response) => { const data = response.data @@ -398,7 +398,7 @@ export function ScriptScreen ({ isOpen, onClose }) { .catch(function (error) { console.error(error) }) - } + }, [dispatch]) async function netlistConfig (file, type) { const formData = new FormData() @@ -415,11 +415,11 @@ export function ScriptScreen ({ isOpen, onClose }) { return await api.post('simulation/upload', formData, config) } - const executeScript = () => { + const executeScript = useCallback(() => { dispatch(setScriptTaskId('')) prepareScriptNetlist(scriptDump) dispatch(setShowDot(false)) - } + }, [dispatch, prepareScriptNetlist, scriptDump]) const resetCode = () => { dispatch(setSchScriptDump('')) @@ -687,7 +687,7 @@ export function OpenSchDialog (props) { useEffect(() => { dispatch(fetchGallery()) - }, []) + }, [dispatch]) useEffect(() => { if (xmlData) { diff --git a/blocks/eda-frontend/src/pages/Gallery.js b/blocks/eda-frontend/src/pages/Gallery.js index e9cb49a6..2d5173eb 100644 --- a/blocks/eda-frontend/src/pages/Gallery.js +++ b/blocks/eda-frontend/src/pages/Gallery.js @@ -206,7 +206,7 @@ const Gallery = () => { useEffect(() => { dispatch(fetchGallery()) - }, []) + }, [dispatch]) // Handle dropdown selection change const handleBookChange = (book) => { diff --git a/blocks/eda-frontend/src/pages/Login.js b/blocks/eda-frontend/src/pages/Login.js index 042490ed..2a2677b4 100644 --- a/blocks/eda-frontend/src/pages/Login.js +++ b/blocks/eda-frontend/src/pages/Login.js @@ -69,7 +69,7 @@ export default function SignIn (props) { return () => { dispatch(authDefault()) } - }, [props.location.search]) + }, [dispatch, props.location.search]) const [username, setUsername] = useState('') const [password, setPassword] = useState('') diff --git a/blocks/eda-frontend/src/pages/NotFound.js b/blocks/eda-frontend/src/pages/NotFound.js index faf327c5..3186d388 100644 --- a/blocks/eda-frontend/src/pages/NotFound.js +++ b/blocks/eda-frontend/src/pages/NotFound.js @@ -16,7 +16,7 @@ export default function NotFound () { useEffect(() => { document.title = 'Not Found - ' + name - }, []) + }, [name]) return ( <Container maxWidth='lg' className={classes.header}> diff --git a/blocks/eda-frontend/src/pages/SchematicEditor.js b/blocks/eda-frontend/src/pages/SchematicEditor.js index 32cedc91..f7db30b9 100644 --- a/blocks/eda-frontend/src/pages/SchematicEditor.js +++ b/blocks/eda-frontend/src/pages/SchematicEditor.js @@ -82,7 +82,7 @@ export default function SchematicEditor (props) { if (xmlData) { renderGalleryXML(xmlData) } - }, [xmlData]) + }, [dispatch, xmlData]) useEffect(() => { document.title = process.env.REACT_APP_DIAGRAM_NAME + ' Editor - ' + process.env.REACT_APP_NAME @@ -104,7 +104,7 @@ export default function SchematicEditor (props) { dispatch(fetchSchematic(cktid)) } } - }, [props.location.search]) + }, [dispatch, props.location.search]) return ( <div className={classes.root}> diff --git a/blocks/eda-frontend/src/pages/signUp.js b/blocks/eda-frontend/src/pages/signUp.js index cba0ebf1..a2adbd76 100644 --- a/blocks/eda-frontend/src/pages/signUp.js +++ b/blocks/eda-frontend/src/pages/signUp.js @@ -60,7 +60,7 @@ export default function SignUp () { return () => { dispatch(authDefault()) } - }, []) + }, [dispatch]) const [email, setEmail] = useState('') const [password, setPassword] = useState('') |