mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-26 17:30:40 +01:00
Fix layer drag&drop and init warning
This commit is contained in:
parent
af2629be75
commit
a8f6208561
1 changed files with 5 additions and 5 deletions
|
@ -486,7 +486,7 @@ export default class App extends React.Component {
|
|||
}
|
||||
|
||||
layers = layers.slice(0);
|
||||
layers = arrayMoveMutable(layers, oldIndex, newIndex);
|
||||
arrayMoveMutable(layers, oldIndex, newIndex);
|
||||
this.onLayersChange(layers);
|
||||
}
|
||||
|
||||
|
@ -764,17 +764,17 @@ export default class App extends React.Component {
|
|||
parseInt(parts[1], 10),
|
||||
];
|
||||
|
||||
let invalid = false;
|
||||
let valid = true;
|
||||
if (hashVal !== "-") {
|
||||
const currentHashVal = hash(JSON.stringify(mapStyle));
|
||||
if (currentHashVal !== parseInt(hashVal, 10)) {
|
||||
invalid = true;
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
if (!invalid) {
|
||||
if (valid) {
|
||||
this.setState({
|
||||
selectedLayerIndex,
|
||||
selectedLayerOriginalId: this.state.mapStyle.layers[selectedLayerIndex].id,
|
||||
selectedLayerOriginalId: mapStyle.layers[selectedLayerIndex].id,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue