From 485ef367c58600b07e56dd09603c4a047d72ac21 Mon Sep 17 00:00:00 2001 From: Junqiu Lei Date: Fri, 26 May 2023 13:25:25 -0500 Subject: [PATCH] Clean console ReferenceError (#418) Signed-off-by: Junqiu Lei --- public/components/map_container/map_container.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/components/map_container/map_container.tsx b/public/components/map_container/map_container.tsx index 98c7bd6d..944fda8d 100644 --- a/public/components/map_container/map_container.tsx +++ b/public/components/map_container/map_container.tsx @@ -241,8 +241,10 @@ export const MapContainer = ({ (indexPattern) => indexPattern.id === selectedLayerConfig.source.indexPatternId ); if (!findIndexPattern) { - // @ts-ignore - const newIndexPattern = await indexPatterns.get(selectedLayerConfig.source.indexPatternId); + const newIndexPattern = await services.data.indexPatterns.get( + // @ts-ignore + selectedLayerConfig.source.indexPatternId + ); const cloneLayersIndexPatterns = [...layersIndexPatterns, newIndexPattern]; setLayersIndexPatterns(cloneLayersIndexPatterns); }