Skip to content

Commit

Permalink
[fix] When editing a custom basemap style do not unintentionally drop…
Browse files Browse the repository at this point in the history
… extra properties (#2327)

Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
  • Loading branch information
igorDykhta committed Sep 20, 2023
1 parent b3472a3 commit 6fd7f7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/reducers/src/map-style-updaters.ts
Expand Up @@ -773,7 +773,10 @@ function getNewStateWithCustomMapStyle(state: MapStyle): MapStyle {
// @ts-expect-error Property 'layerGroups' is missing in type 'InputStyle' but required in type 'BaseMapStyle'. Legacy case?
mapStyles: {
...state.mapStyles,
[styleId]: state.inputStyle
[styleId]: {
...state.mapStyles[styleId], // do not unintentionally drop any additional properties
...state.inputStyle
}
},
// set to default
inputStyle: getInitialInputStyle()
Expand Down

0 comments on commit 6fd7f7a

Please sign in to comment.