Skip to content

Commit

Permalink
Also refresh snapping feature cache when new layers appear
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Mar 19, 2024
1 parent 707f7d2 commit 6a00b51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/map/SnappingSupport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ class SnappingSupport extends React.Component {
const layersChanged = this.props.layers.find(layer => {
if (layer.role === LayerRole.THEME) {
const prev = prevProps.layers.find(prevLayer => layer.uuid === prevLayer.uuid);
return prev && layer.rev !== prev.rev;
return !prev || layer.rev !== prev.rev;
} else if (layer.role === LayerRole.USERLAYER && layer.type === 'vector') {
const prev = prevProps.layers.find(prevLayer => layer.uuid === prevLayer.uuid);
return prev && prev.features !== layer.features;
return !prev || prev.features !== layer.features;
}
return false;
});
Expand Down

0 comments on commit 6a00b51

Please sign in to comment.