feat: add automatic data polling, conditional search visibility, and extended scraper functionality for monthly lake records

This commit is contained in:
David Fencl
2026-06-06 12:34:20 +02:00
parent dbb22e7972
commit db1aadcc8d
18 changed files with 2731 additions and 152 deletions
+10 -4
View File
@@ -170,10 +170,16 @@ const LakesOverview = ({ language }: Props) => {
const { isFavorite, toggleFavorite, favorites } = useFavorites();
useEffect(() => {
fetch(`/data/lakes_index.json?t=${Date.now()}`)
.then(res => res.json())
.then(data => setLakes(data))
.catch(err => console.error(err));
const loadData = () => {
fetch(`/data/lakes_index.json?t=${Date.now()}`)
.then(res => res.json())
.then(data => setLakes(data))
.catch(err => console.error(err));
};
loadData();
const intervalId = setInterval(loadData, 60 * 1000); // Poll every 1 minute
return () => clearInterval(intervalId);
}, []);
const favoriteLakes = lakes.filter(l => isFavorite(l.id));