diff --git a/src/components/App.jsx b/src/components/App.jsx index 9736392..5b466ea 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -134,7 +134,6 @@ export default function App() { setAppName(arg.appName); setAppVersion(arg.appVersion); }); - readConfig(); }, []); const classes = useStyles(); @@ -163,6 +162,7 @@ export default function App() { } console.log(appName, appVersion); + readConfig(); let windowView; if (isDashboard) { diff --git a/src/components/Nodes.jsx b/src/components/Nodes.jsx index 452e38e..87fa6cd 100644 --- a/src/components/Nodes.jsx +++ b/src/components/Nodes.jsx @@ -51,7 +51,6 @@ const useStyles = makeStyles(theme => ({ export default function Nodes() { const [data, setData] = useState({}); const [isLoaded, setLoaded] = useState(false); - const [isDatabase, setDatabase] = useState(true); const isRemoteDB = false //for split button @@ -72,9 +71,9 @@ export default function Nodes() { if (isActive) return "secondary"; }; - const activateDatabase = () => { - setDatabase(true); - }; + // const activateDatabase = () => { + // setDatabase(true); + // }; const handleMenuItemClick = (event, index) => { setSelectedIndex(index); @@ -101,7 +100,7 @@ export default function Nodes() { useEffect(() => { let didCancel = false; async function fetchData() { - if (isDatabase) { + if (db !=null) { db.query(queryText, (err, res) => { if (!err && !didCancel) { setData(res.rows); @@ -111,7 +110,7 @@ export default function Nodes() { } } - if (isDatabase) { + if (db != null) { fetchData(); if (isIntervel) { setInterval(() => { @@ -122,18 +121,18 @@ export default function Nodes() { return () => { didCancel = true; }; - }, [isDatabase, fetchInterval, isIntervel]); + }, [fetchInterval, isIntervel]); let nodesTable; if (isLoaded && data) { - if (isDatabase === false) { + if (db == null) { nodesTable = (