more logging

This commit is contained in:
Mitchell McCaffrey 2020-10-23 23:18:57 +11:00
parent 2e5d52b6ac
commit b91d0e4157
2 changed files with 4 additions and 1 deletions

View File

@ -131,6 +131,7 @@ export function MapDataProvider({ children }) {
} }
async function updateMap(id, update) { async function updateMap(id, update) {
console.log("updating", update);
await database.table("maps").update(id, update); await database.table("maps").update(id, update);
setMaps((prevMaps) => { setMaps((prevMaps) => {
const newMaps = [...prevMaps]; const newMaps = [...prevMaps];
@ -140,6 +141,7 @@ export function MapDataProvider({ children }) {
} }
return newMaps; return newMaps;
}); });
console.log("updated");
} }
async function updateMaps(ids, update) { async function updateMaps(ids, update) {
@ -176,6 +178,7 @@ export function MapDataProvider({ children }) {
* @param {Object} map the map to put * @param {Object} map the map to put
*/ */
async function putMap(map) { async function putMap(map) {
console.log("putting", map);
await database.table("maps").put(map); await database.table("maps").put(map);
setMaps((prevMaps) => { setMaps((prevMaps) => {
const newMaps = [...prevMaps]; const newMaps = [...prevMaps];
@ -190,6 +193,7 @@ export function MapDataProvider({ children }) {
if (map.owner !== userId) { if (map.owner !== userId) {
await updateCache(); await updateCache();
} }
console.log("map put");
} }
/** /**

View File

@ -85,7 +85,6 @@ function Game() {
// Join game // Join game
useEffect(() => { useEffect(() => {
if (databaseStatus !== "loading") { if (databaseStatus !== "loading") {
console.log("join", databaseStatus);
session.joinParty(gameId, password); session.joinParty(gameId, password);
} }
}, [gameId, password, databaseStatus]); }, [gameId, password, databaseStatus]);