From d8f8fb6059ad011257c22c1776147b3c75c841b6 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Sun, 26 Apr 2020 11:37:03 +1000 Subject: [PATCH] Removed owner data from map state --- src/modals/SelectMapModal.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/modals/SelectMapModal.js b/src/modals/SelectMapModal.js index d1122fc..9de81f3 100644 --- a/src/modals/SelectMapModal.js +++ b/src/modals/SelectMapModal.js @@ -56,9 +56,7 @@ function SelectMapModal({ // Add a state for the map if there isn't one already const state = await db.table("states").get(id); if (!state) { - await db - .table("states") - .add({ ...defaultMapState, mapId: id, owner: userId }); + await db.table("states").add({ ...defaultMapState, mapId: id }); } } return defaultMapsWithIds; @@ -130,9 +128,7 @@ function SelectMapModal({ async function handleMapAdd(map) { await db.table("maps").add(map); - await db - .table("states") - .add({ ...defaultMapState, mapId: map.id, owner: userId }); + await db.table("states").add({ ...defaultMapState, mapId: map.id }); setMaps((prevMaps) => [map, ...prevMaps]); setSelectedMap(map); setGridX(map.gridX); @@ -160,7 +156,7 @@ function SelectMapModal({ } async function handleMapReset(id) { - const state = { ...defaultMapState, mapId: id, owner: userId }; + const state = { ...defaultMapState, mapId: id }; await db.table("states").put(state); // Reset the state of the current map if needed if (currentMap && currentMap.id === selectedMap.id) {