diff --git a/js/extension/components/information/Buildings.jsx b/js/extension/components/information/Buildings.jsx index 52a1eae..efc5c89 100644 --- a/js/extension/components/information/Buildings.jsx +++ b/js/extension/components/information/Buildings.jsx @@ -31,12 +31,14 @@ export default function Buildings({ const [loading, setLoading] = useState(false); useEffect(() => { - setLoading(true); - getBatiments({ parcelle, dnubat: letter }).then((data) => { - setBuildings(data); - setSelected([]); - setLoading(false); - }); + if (letter) { + setLoading(true); + getBatiments({ parcelle, dnubat: letter }).then((data) => { + setBuildings(data); + setSelected([]); + setLoading(false); + }); + } }, [letter]); // Description