Skip to content

Commit

Permalink
fix: remove unused filter
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic-maury committed Mar 29, 2024
1 parent fe27763 commit 7042181
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions frontend/src/components/Map/MapMarkers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ function filterProperties(
displayAll: boolean,
displayGnosis: boolean,
displayRmm: boolean,
displayedWalletsAddresses: string[],
) {
return properties
.filter((property) => {
Expand All @@ -55,13 +54,6 @@ function filterProperties(
if (!displayRmm && property.source === 'rmm') {
toInclude = false;
}
if (
displayedWalletsAddresses.length > 0
&& property.ownerWallets.length > 0
&& !property.ownerWallets.some((address) => displayedWalletsAddresses.includes(address.toLowerCase()))
) {
toInclude = false;
}
return toInclude;
})
}
Expand Down Expand Up @@ -116,10 +108,6 @@ export function MapMarkers({
markerOpacity,
} = useAppSelector((state) => state.mapOptions);

const displayedWalletsAddresses = wallets
.filter((wallet) => wallet.visible)
.map((wallet) => wallet.address.toLowerCase());

function onMarkerClicked(event: LeafletMouseEvent, property: Property) {
const currentZoom = map.getZoom();
map.setView({
Expand Down Expand Up @@ -170,7 +158,7 @@ export function MapMarkers({
clearMap();
markerCluster = getCleanMarkerCluster();

filterProperties(properties, displayAll, displayGnosis, displayRmm, displayedWalletsAddresses)
filterProperties(properties, displayAll, displayGnosis, displayRmm)
.forEach((property) => {
const marker = createMarker(property, markerOpacity, t)
.addEventListener('click', (event) => onMarkerClicked(event, property));
Expand All @@ -180,7 +168,7 @@ export function MapMarkers({
map.addLayer(markerCluster);

// eslint-disable-next-line react-hooks/exhaustive-deps
}, [properties, displayAll, displayGnosis, displayRmm, displayedWalletsAddresses]);
}, [properties, displayAll, displayGnosis, displayRmm]);

return null;
}

0 comments on commit 7042181

Please sign in to comment.