From d71b8c4ea52446abd127d17c719f47c140de369c Mon Sep 17 00:00:00 2001 From: Renee Pinna Date: Sun, 22 Oct 2023 09:04:12 -0600 Subject: [PATCH] Handle lint errors --- src/Components/SearchResults/SearchResults.js | 8 +++----- src/Map/MapController.js | 10 +++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Components/SearchResults/SearchResults.js b/src/Components/SearchResults/SearchResults.js index 0c9a20a..ba6fc10 100644 --- a/src/Components/SearchResults/SearchResults.js +++ b/src/Components/SearchResults/SearchResults.js @@ -11,13 +11,11 @@ export default function SearchResults({ searchFilter, }) { const [searchResults, setSearchResults] = useState([]); - const [noResults, setNoResults] = useState(true); useEffect(() => { - const noResults = data?.aidRequests.length ? false : true; - setNoResults(noResults); - - let results = data ? data.aidRequests.filter(request => request.status === 'active') : []; + let results = data + ? data.aidRequests.filter(request => request.status === 'active') + : []; if (searchFilter) { results = results.filter( diff --git a/src/Map/MapController.js b/src/Map/MapController.js index b7e84ff..5fc6f19 100644 --- a/src/Map/MapController.js +++ b/src/Map/MapController.js @@ -1,12 +1,12 @@ -import {useEffect} from 'react' -import { useMap } from 'react-leaflet' +import { useEffect } from 'react'; +import { useMap } from 'react-leaflet'; -export default function MapController({latLon}) { +export default function MapController({ latLon }) { const map = useMap(); useEffect(() => { - map.flyTo(latLon, 15, {duration: 1.5}) - }, [latLon]) + map.flyTo(latLon, 15, { duration: 1.5 }); + }, [latLon, map]); return null; }