Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mbwatson committed May 4, 2024
1 parent a7c3c62 commit ef593b6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/context/map-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,23 @@ export const LayersProvider = ({ children }) => {
};

const removeLayer = id => {
const index = defaultModelLayers.findIndex(l => l.id === id)
const index = defaultModelLayers.findIndex(l => l.id === id);
if (index === -1) {
return
return;
}
const thisPosition = defaultModelLayers[index].state.order
const thisPosition = defaultModelLayers[index].state.order;
const newLayers = defaultModelLayers.reduce((acc, l) => {
if (l.state.order === thisPosition) {
return acc
return acc;
}
if (l.state.order > thisPosition) {
l.state.order -= 1;
}
acc.push(l)
return acc
}, [])
acc.push(l);
return acc;
}, []);

setDefaultModelLayers(newLayers)
setDefaultModelLayers(newLayers);
/* todo: update `layer.state.order`s
layer.state.order - 1 for all layers l with l.state.order > this layer's state.order
*/
Expand Down

0 comments on commit ef593b6

Please sign in to comment.