From 36f6f1f587b92ece36404b03e3ce77064e5df3fa Mon Sep 17 00:00:00 2001 From: Claire Dagan Date: Tue, 12 Nov 2024 17:35:55 +0100 Subject: [PATCH] [Tech] use `areRegulatoryResultsOpen` instead of `isRegulatorySearchResultsVisible` --- .../src/features/layersSelector/search/ResultsList/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/features/layersSelector/search/ResultsList/index.tsx b/frontend/src/features/layersSelector/search/ResultsList/index.tsx index a7c20d415..d8f7bcd7c 100644 --- a/frontend/src/features/layersSelector/search/ResultsList/index.tsx +++ b/frontend/src/features/layersSelector/search/ResultsList/index.tsx @@ -54,7 +54,7 @@ export function ResultList({ searchedText }: ResultListProps) { const { data: regulatoryLayers } = useGetRegulatoryLayersQuery() const regulatoryLayersByLayerName = groupBy( - !regulatoryLayersSearchResult && isRegulatorySearchResultsVisible + !regulatoryLayersSearchResult && areRegulatoryResultsOpen ? regulatoryLayers?.ids : regulatoryLayersSearchResult ?? [], r => regulatoryLayers?.entities[r]?.layer_name @@ -63,7 +63,7 @@ export function ResultList({ searchedText }: ResultListProps) { const { data: amps } = useGetAMPsQuery() const ampResultsByAMPName = groupBy( - !ampsSearchResult && isAmpSearchResultsVisible ? amps?.ids : ampsSearchResult ?? [], + !ampsSearchResult && areAmpsResultsOpen ? amps?.ids : ampsSearchResult ?? [], a => amps?.entities[a]?.name ) const totalAmps = ampsSearchResult?.length ?? amps?.ids?.length ?? 0