diff --git a/src/App.js b/src/App.js index e7d9c66..0a3ea8e 100644 --- a/src/App.js +++ b/src/App.js @@ -85,19 +85,25 @@ function RoomResearch({ callbackRoomSelected }) { > } -function RoomInformation({ roomId }) { +function RoomInformation({ roomId, setIsEditDialogOpen }) { const [names, setNames] = React.useState([]); const [users, setUsers] = React.useState([]); React.useEffect(() => { - fetch("https://encartes.aliens-lyon.fr/api/map/get_place_info/" + roomId) - .then(response => response.json()) - .then(data => { - setNames(data.names); - setUsers(data.users); - }); + if (roomId !== null) { + fetch("https://encartes.aliens-lyon.fr/api/map/get_place_info/" + roomId) + .then(response => response.json()) + .then(data => { + setNames(data.names); + setUsers(data.users); + }); + } }, [roomId]); + if (roomId === null) { + return; + } + return