Skip to content

Commit

Permalink
[fix] Update layer domain in addLayer (#2393)
Browse files Browse the repository at this point in the history
Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
  • Loading branch information
igorDykhta committed Oct 24, 2023
1 parent bed4b7f commit 81a6e1f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/reducers/src/vis-state-updaters.ts
Expand Up @@ -1320,14 +1320,21 @@ export const addLayerUpdater = (
});
newLayerData = {};
}
return {

let newState = {
...state,
layers: [...state.layers, newLayer],
layerData: [...state.layerData, newLayerData],
// add new layer at the top
layerOrder: [newLayer.id, ...state.layerOrder],
splitMaps: addNewLayersToSplitMap(state.splitMaps, newLayer)
};

if (newLayer.config.animation.enabled) {
newState = updateAnimationDomain(newState);
}

return newState;
};

/**
Expand Down

0 comments on commit 81a6e1f

Please sign in to comment.