mirror of
https://github.com/maputnik/editor.git
synced 2025-12-26 16:10:01 +00:00
Guard against errors producing dirty map state.
This commit is contained in:
@@ -354,8 +354,15 @@ export default class App extends React.Component {
|
||||
|
||||
errors.forEach(error => {
|
||||
const {message} = error;
|
||||
const objPath = message.split(":")[0];
|
||||
unset(dirtyMapStyle, objPath);
|
||||
if (message) {
|
||||
try {
|
||||
const objPath = message.split(":")[0];
|
||||
unset(dirtyMapStyle, objPath);
|
||||
}
|
||||
catch (err) {
|
||||
console.warn(err);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -475,7 +482,6 @@ export default class App extends React.Component {
|
||||
}
|
||||
|
||||
onLayerChanged = (layer) => {
|
||||
console.log("test: onLayerChanged", layer);
|
||||
const changedLayers = this.state.mapStyle.layers.slice(0)
|
||||
const idx = style.indexOfLayer(changedLayers, layer.id)
|
||||
changedLayers[idx] = layer
|
||||
|
||||
Reference in New Issue
Block a user