Skip to content

Commit

Permalink
refactor: remove more ===
Browse files Browse the repository at this point in the history
  • Loading branch information
clintonlunn committed Dec 3, 2024
1 parent 38510fa commit a83f937
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/maps/GlobalMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const GlobalMap: React.FC<GlobalMapProps> = ({
const urlParams = useUrlParams()

const setActiveFeatureVisual = (feature: ActiveFeature | null, fState: FeatureState): void => {
if (feature === null || mapInstance === null) return
if (feature == null || mapInstance == null) return
mapInstance.setFeatureState({
source: 'areas',
sourceLayer: 'areas',
Expand All @@ -80,7 +80,7 @@ export const GlobalMap: React.FC<GlobalMapProps> = ({
}

const onMoveEnd = useCallback((e: ViewStateChangeEvent) => {
if ((mapInstance === null) || e.viewState === null || (onCameraMovement === undefined)) return
if ((mapInstance == null) || e.viewState == null || (onCameraMovement === undefined)) return
onCameraMovement({
center: {
lat: e.viewState.latitude,
Expand All @@ -91,7 +91,7 @@ export const GlobalMap: React.FC<GlobalMapProps> = ({
}, [mapInstance, onCameraMovement])

const onLoad = useCallback((e: MapLibreEvent) => {
if (e.target === null) return
if (e.target == null) return
setMapInstance(e.target)

// Only apply jumpTo if initial values are defined
Expand All @@ -106,7 +106,7 @@ export const GlobalMap: React.FC<GlobalMapProps> = ({
* Handle click event on the map. Place a marker on the map and activate the side drawer.
*/
const onClick = (event: MapLayerMouseEvent): void => {
if (mapInstance === null) return
if (mapInstance == null) return
const feature = event?.features?.[0]
handleOnClick?.(event)
if (feature === undefined) {
Expand Down Expand Up @@ -188,7 +188,7 @@ export const GlobalMap: React.FC<GlobalMapProps> = ({
}, [])

useEffect(() => {
if (mapInstance === null) return
if (mapInstance == null) return

if (!isSourceLoaded) {
mapInstance.on('sourcedata', (e) => {
Expand Down

0 comments on commit a83f937

Please sign in to comment.