From 0a12ebc7721c990798f49cf2a5363d9f7cf5534e Mon Sep 17 00:00:00 2001 From: bartwr Date: Sat, 6 Apr 2024 16:48:00 +0200 Subject: [PATCH] Hide NS parkings on municipality parkings page --- src/pages/content.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pages/content.tsx b/src/pages/content.tsx index 86b22bd..c2d9c5d 100644 --- a/src/pages/content.tsx +++ b/src/pages/content.tsx @@ -197,7 +197,14 @@ const Content: NextPage = ({ fietsenstallingen }) => { > {parkingTypesToFilterOn && { - return parkingTypesToFilterOn.indexOf(x.Type) > -1 && activeMunicipalityInfo.CompanyName?.toLowerCase().indexOf(x.Plaats?.toLowerCase()) > -1; + return parkingTypesToFilterOn.indexOf(x.Type) > -1 + && ( + // Check if parking municipality == active municipality + (activeMunicipalityInfo.CompanyName && activeMunicipalityInfo.CompanyName.toLowerCase().indexOf(x.Plaats?.toLowerCase()) > -1) + // Hide parkings without municipality, if municipality is set + // This makes sure not all Dutch NS stallingen are shown on a municipality page + && (x.Plaats && x.Plaats.length > 0) + ); }} onShowStallingDetails={(id: any) => { setCurrentStallingId(id);