Skip to content

Commit

Permalink
fix bug with immutable nebula-gl objects
Browse files Browse the repository at this point in the history
  • Loading branch information
juandjara committed Mar 13, 2024
1 parent efc1516 commit 5b62f1b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/react-widgets/src/layers/FeatureSelectionLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,17 @@ export default function FeatureSelectionLayer(
if (updatedData.features.length !== 0 && !editType.includes('Tentative')) {
const [lastFeature] = updatedData.features.slice(-1);
const intersectionPoints = kinks(lastFeature).features.length;
lastFeature.properties.invalid = intersectionPoints > 0;

if (lastFeature) {
dispatch(
addSpatialFilter({
geometry: lastFeature
geometry: {
...lastFeature,
properties: {
...lastFeature.properties,
invalid: intersectionPoints > 0
}
}
})
);
}
Expand Down

0 comments on commit 5b62f1b

Please sign in to comment.