Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
jolevesq committed Dec 20, 2024
1 parent e5afa70 commit 7226c6c
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -811,16 +811,6 @@ export function initializeMapState(set: TypeSetStore, get: TypeGetStore): IMapSt
* @param {boolean} collapsed - Flag indicating if the layer should be hoverable.
*/
setLegendCollapsed: (layerPath: string, collapsed?: boolean): void => {
// const curLayerInfo = get().mapState.orderedLayerInfo;
// const layerInfo = curLayerInfo.find((info) => info.layerPath === layerPath);
// if (layerInfo) {
// const newCollapsed = collapsed || !layerInfo.legendCollapsed;
// layerInfo.legendCollapsed = newCollapsed;

// // Redirect
// get().mapState.setterActions.setOrderedLayerInfo(curLayerInfo);
// }

const curLayerInfo = get().mapState.orderedLayerInfo;
const layerIndex = curLayerInfo.findIndex((info) => info.layerPath === layerPath);

Expand All @@ -833,6 +823,7 @@ export function initializeMapState(set: TypeSetStore, get: TypeGetStore): IMapSt
legendCollapsed: collapsed ?? !curLayerInfo[layerIndex].legendCollapsed,
};

// Redirect
get().mapState.setterActions.setOrderedLayerInfo(newLayerInfo);
}
},
Expand Down

0 comments on commit 7226c6c

Please sign in to comment.