Finish corr implementation for draw offers (untested)
[vchess.git] / client / src / utils / gameStorage.js
index dc65379..668a230 100644 (file)
@@ -1,6 +1,6 @@
 // Game object: {
 //   // Static informations:
-//   gameId: string
+//   id: string
 //   vname: string,
 //   fenStart: string,
 //   players: array of sid+id+name,
@@ -39,7 +39,7 @@ function dbOperation(callback)
       alert("Error while loading database: " + event.target.errorCode);
     };
     // Create objectStore for vchess->games
-    let objectStore = db.createObjectStore("games", { keyPath: "gameId" });
+    let objectStore = db.createObjectStore("games", { keyPath: "id" });
     objectStore.createIndex("score", "score"); //to search by game result
   }
 }
@@ -82,6 +82,7 @@ export const GameStorage =
             move: obj.move, //may be undefined...
             fen: obj.fen,
             score: obj.score,
+            drawOffer: obj.drawOffer,
           }
         }
       );