From 4e131497e62449cfb2e2fa19950265bfdfb1edac Mon Sep 17 00:00:00 2001 From: Yves Choquette Date: Fri, 10 Nov 2023 10:50:30 -0500 Subject: [PATCH] 1487-BUG_Details right panel should be empty --- common/config/rush/pnpm-lock.yaml | 12 ++++++------ .../core/components/details/layers-list-footer.tsx | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index cff038ffb76..f213f18d022 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4088,7 +4088,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001561 - electron-to-chromium: 1.4.579 + electron-to-chromium: 1.4.580 node-releases: 2.0.13 update-browserslist-db: 1.0.13_browserslist@4.22.1 dev: true @@ -4750,8 +4750,8 @@ packages: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: true - /electron-to-chromium/1.4.579: - resolution: {integrity: sha512-bJKvA+awBIzYR0xRced7PrQuRIwGQPpo6ZLP62GAShahU9fWpsNN2IP6BSP1BLDDSbxvBVRGAMWlvVVq3npmLA==} + /electron-to-chromium/1.4.580: + resolution: {integrity: sha512-T5q3pjQon853xxxHUq3ZP68ZpvJHuSMY2+BZaW3QzjS4HvNuvsMmZ/+lU+nCrftre1jFZ+OSlExynXWBihnXzw==} dev: true /email-addresses/3.1.0: @@ -4876,8 +4876,8 @@ packages: safe-array-concat: 1.0.1 dev: true - /es-module-lexer/1.3.1: - resolution: {integrity: sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q==} + /es-module-lexer/1.4.0: + resolution: {integrity: sha512-lcCr3v3OLezdfFyx9r5NRYHOUTQNnFEQ9E87Mx8Kc+iqyJNkO7MJoB4GQRTlIMw9kLLTwGw0OAkm4BQQud/d9g==} dev: true /es-set-tostringtag/2.0.2: @@ -9611,7 +9611,7 @@ packages: browserslist: 4.22.1 chrome-trace-event: 1.0.3 enhanced-resolve: 5.15.0 - es-module-lexer: 1.3.1 + es-module-lexer: 1.4.0 eslint-scope: 5.1.1 events: 3.3.0 glob-to-regexp: 0.4.1 diff --git a/packages/geoview-core/src/core/components/details/layers-list-footer.tsx b/packages/geoview-core/src/core/components/details/layers-list-footer.tsx index 150f53f1581..9f46efbf99e 100644 --- a/packages/geoview-core/src/core/components/details/layers-list-footer.tsx +++ b/packages/geoview-core/src/core/components/details/layers-list-footer.tsx @@ -154,11 +154,10 @@ export function LayersListFooter(props: TypeLayersListProps): JSX.Element { if (arrayOfLayerData.length > 0) { // Check if have the previous selected layer path in incoming arrayOfLayerData // if so, get the index of the found layer, we need to pass to setLayerDataInfo to load layer in left panel - const commonLayerPathIndex = findLayerPathIndex(arrayOfLayerData, selectedLayerPath); + const commonLayerPathIndex = selectedLayerPath ? findLayerPathIndex(arrayOfLayerData, selectedLayerPath) : -1; setLayerDataInfo(arrayOfLayerData[commonLayerPathIndex > -1 ? commonLayerPathIndex : 0]); - setSelectedLayerPath(arrayOfLayerData[commonLayerPathIndex > -1 ? commonLayerPathIndex : 0].layerPath); setCurrentFeatureIndex(0); - } + } else setLayerDataInfo(null); // eslint-disable-next-line react-hooks/exhaustive-deps }, [arrayOfLayerData]);