diff --git a/Website/App.tsx b/Website/App.tsx index 17cb48d..f67ac77 100644 --- a/Website/App.tsx +++ b/Website/App.tsx @@ -9,6 +9,7 @@ export default function App(){ const [connected, setConnected] = React.useState(false); const [showSearch, setShowSearch] = React.useState(false); const [lastMangaListUpdate, setLastMangaListUpdate] = React.useState(new Date()); + const [lastJobListUpdate, setLastJobListUpdate] = React.useState(new Date()); useEffect(() => { getData('http://127.0.0.1:6531/v2/Ping').then((result) => { @@ -18,12 +19,19 @@ export default function App(){ }else{ setConnected(true); } - }) + + const interval = setInterval(() => { + setLastJobListUpdate(new Date()); + }, 1000); + + return () => clearInterval(interval); + }); }, []); const JobsChanged : EventHandler = () => { console.log("Updating Mangalist"); setLastMangaListUpdate(new Date()); + setLastJobListUpdate(new Date()); } return(
@@ -36,11 +44,10 @@ export default function App(){
: <>} - setShowSearch(true)} onJobsChanged={JobsChanged} - key={lastMangaListUpdate.getTime()}/> + setShowSearch(true)} onJobsChanged={JobsChanged} key={lastMangaListUpdate.getTime()}/> :

No connection to backend

} -
) }