diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index cb1d28b..b52e4b9 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -126,11 +126,6 @@ const App = () => { }, [state]); useEffect(() => { - // Fetch data from the API when the component mounts - fetch(`http://${hostname}:${port}/service-properties`) - .then((response) => response.json()) - .then((data: DataServiceJSON) => dispatch({ type: 'SET_DATA', data })); - // Allow the user to add a custom css file fetch(`http://${hostname}:${port}/custom.css`) .then((response) => { @@ -145,7 +140,13 @@ const App = () => { }) .catch(console.error); // Handle the error appropriately - socket.on('connect', () => setConnectionStatus('connected')); + socket.on('connect', () => { + // Fetch data from the API when the client connects + fetch(`http://${hostname}:${port}/service-properties`) + .then((response) => response.json()) + .then((data: DataServiceJSON) => dispatch({ type: 'SET_DATA', data })); + setConnectionStatus('connected'); + }); socket.on('disconnect', () => { setConnectionStatus('disconnected'); setTimeout(() => { @@ -222,7 +223,7 @@ const App = () => { // While the data is loading if (!state) { - return

Loading...

; + return ; } return ( <> diff --git a/src/pydase/frontend/asset-manifest.json b/src/pydase/frontend/asset-manifest.json index 61f02b8..ff1c535 100644 --- a/src/pydase/frontend/asset-manifest.json +++ b/src/pydase/frontend/asset-manifest.json @@ -1,13 +1,13 @@ { "files": { "main.css": "/static/css/main.c444b055.css", - "main.js": "/static/js/main.9a4bacc5.js", + "main.js": "/static/js/main.964bc334.js", "index.html": "/index.html", "main.c444b055.css.map": "/static/css/main.c444b055.css.map", - "main.9a4bacc5.js.map": "/static/js/main.9a4bacc5.js.map" + "main.964bc334.js.map": "/static/js/main.964bc334.js.map" }, "entrypoints": [ "static/css/main.c444b055.css", - "static/js/main.9a4bacc5.js" + "static/js/main.964bc334.js" ] } \ No newline at end of file diff --git a/src/pydase/frontend/index.html b/src/pydase/frontend/index.html index b78c369..a64c694 100644 --- a/src/pydase/frontend/index.html +++ b/src/pydase/frontend/index.html @@ -1 +1 @@ -pydase App
\ No newline at end of file +pydase App
\ No newline at end of file diff --git a/src/pydase/frontend/static/js/main.9a4bacc5.js b/src/pydase/frontend/static/js/main.964bc334.js similarity index 99% rename from src/pydase/frontend/static/js/main.9a4bacc5.js rename to src/pydase/frontend/static/js/main.964bc334.js index 84d00a0..f48699c 100644 --- a/src/pydase/frontend/static/js/main.9a4bacc5.js +++ b/src/pydase/frontend/static/js/main.964bc334.js @@ -1,3 +1,3 @@ -/*! For license information please see main.9a4bacc5.js.LICENSE.txt */ -!function(){var e={694:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t