Linien Daten aktualisieren

This commit is contained in:
ISA
2024-09-18 11:06:26 +02:00
parent fbb3dac38b
commit 41454f7efe
4 changed files with 15 additions and 7 deletions

View File

@@ -103,7 +103,15 @@ const useLineData = (webserviceGisLinesStatusUrl, setLineStatusData) => {
}
};
const scheduleNextFetch = () => {
if (!isCancelled) {
fetchData();
setTimeout(scheduleNextFetch, 30000);
}
};
fetchData();
scheduleNextFetch();
return () => {
isCancelled = true;