Skip to content

Commit a16e114

Browse files
committed
Remove AI comments
1 parent 04eecd9 commit a16e114

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

src/components/map/MapPage.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -350,20 +350,17 @@ const MapPage = ({ isDesktop }) => {
350350
[isDesktop, pathname, dispatch, history],
351351
)
352352

353-
// Set up map click listener using Google Maps native events
354353
useEffect(() => {
355354
if (!googleMap || !getGoogleMaps) {
356355
return
357356
}
358357

359358
const google = getGoogleMaps()
360359

361-
// Remove previous listener if it exists
362360
if (mapClickListenerRef.current) {
363361
google.event.removeListener(mapClickListenerRef.current)
364362
}
365363

366-
// Add new listener
367364
mapClickListenerRef.current = google.event.addListener(
368365
googleMap,
369366
'click',
@@ -374,7 +371,6 @@ const MapPage = ({ isDesktop }) => {
374371
},
375372
)
376373

377-
// Cleanup function
378374
return () => {
379375
if (mapClickListenerRef.current) {
380376
google.event.removeListener(mapClickListenerRef.current)
@@ -555,9 +551,6 @@ const MapPage = ({ isDesktop }) => {
555551
googleMap={googleMap}
556552
getGoogleMaps={getGoogleMaps}
557553
onLocationClick={handleLocationClick}
558-
selectedLocationId={locationId}
559-
isEditingLocation={isEditingLocation}
560-
isAddingLocation={isAddingLocation}
561554
showLabels={showLabels}
562555
/>
563556
{(isEditingLocation || isAddingLocation) && draggedPosition && (

src/redux/mapSlice.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,17 @@ export const mapSlice = createSlice({
124124
state.locations = action.payload
125125
state.isFilterUpdated = false
126126
} else {
127-
// Drop locations out of bounds
128127
const locationsInBounds = state.locations.filter(
129128
({ lat, lng }) =>
130129
lat <= north && lng <= east && lat >= south && lng >= west,
131130
)
132-
// Combine with new locations in bounds using Map for O(n+m) performance
133-
// Payload items take priority over existing locations
134131
const locationMap = new Map()
135132

136-
// First add existing locations in bounds
137133
locationsInBounds.forEach((loc) => {
138134
locationMap.set(loc.id, loc)
139135
})
140136

141-
// Then add/overwrite with payload locations (these take priority)
137+
// add/overwrite with payload locations (these take priority)
142138
action.payload.forEach((loc) => {
143139
locationMap.set(loc.id, loc)
144140
})

0 commit comments

Comments
 (0)