Updated update map

This commit is contained in:
Mitchell McCaffrey 2020-10-23 23:45:39 +11:00
parent 97c436b5e4
commit b70bcdabd2

View File

@ -132,7 +132,11 @@ export function MapDataProvider({ children }) {
async function updateMap(id, update) {
console.log("updating", id, update);
try {
await database.table("maps").update(id, update);
} catch (error) {
console.error(error);
}
setMaps((prevMaps) => {
const newMaps = [...prevMaps];
const i = newMaps.findIndex((map) => map.id === id);