Added multi map remove to map data context

This commit is contained in:
Mitchell McCaffrey
2020-09-30 15:44:48 +10:00
parent 29ce562d01
commit 99b2bd0240
2 changed files with 18 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ function SelectMapModal({
ownedMaps,
mapStates,
addMap,
removeMap,
removeMaps,
resetMap,
updateMap,
} = useContext(MapDataContext);
@@ -199,9 +199,7 @@ function SelectMapModal({
}
async function handleMapsRemove() {
for (let id of selectedMapIds) {
await removeMap(id);
}
await removeMaps(selectedMapIds);
setSelectedMapIds([]);
// Removed the map from the map screen if needed
if (currentMap && selectedMapIds.includes(currentMap.id)) {