From b70bcdabd2b55d5325341c4271ae90539600ae21 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Fri, 23 Oct 2020 23:45:39 +1100 Subject: [PATCH] Updated update map --- src/contexts/MapDataContext.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/contexts/MapDataContext.js b/src/contexts/MapDataContext.js index 830f6b6..349b46c 100644 --- a/src/contexts/MapDataContext.js +++ b/src/contexts/MapDataContext.js @@ -132,7 +132,11 @@ export function MapDataProvider({ children }) { async function updateMap(id, update) { console.log("updating", id, update); - await database.table("maps").update(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);