Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commit

Permalink
fix(map): if no search query error
Browse files Browse the repository at this point in the history
  • Loading branch information
Wamibee committed Mar 7, 2022
1 parent b3e4a3a commit 4404a32
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const Map = (props) => {
// Récupération des paramètres de filtre
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
let mapSearchQuery = urlParams.get('search').replace('-', ' ');

let mapSearchQuery = urlParams.get('search')
if(mapSearchQuery) mapSearchQuery = mapSearchQuery.replace('-', ' ');
let mapUserQuery = urlParams.get('user');

mapboxgl.accessToken = process.env.REACT_APP_MAPBOX_ACCESS_TOKEN;
Expand Down

0 comments on commit 4404a32

Please sign in to comment.