Skip to content

Commit

Permalink
Merge pull request #1488 from ychoquet/1487-BUG_Details-right-panel-s…
Browse files Browse the repository at this point in the history
…hould-be-empty

1487-BUG_Details right panel should be empty (#1488)
  • Loading branch information
jolevesq authored Nov 10, 2023
2 parents 53ad436 + 4e13149 commit 5ecc18c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down

0 comments on commit 5ecc18c

Please sign in to comment.