Draft game upload logic (unwritten yet for Analysis mode)
[vchess.git] / client / src / utils / compgameStorage.js
index a8bcaa2..655fd6b 100644 (file)
@@ -15,7 +15,8 @@ function dbOperation(callback) {
   let DBOpenRequest = window.indexedDB.open("vchess_comp", 4);
 
   DBOpenRequest.onerror = function(event) {
-    alert(store.state.tr["Database error: stop private browsing, or update your browser"]);
+    alert(store.state.tr[
+      "Database error: stop private browsing, or update your browser"]);
     callback("error", null);
   };
 
@@ -37,7 +38,7 @@ function dbOperation(callback) {
 
 export const CompgameStorage = {
   add: function(game) {
-    dbOperation((err,db) => {
+    dbOperation((err, db) => {
       if (err) return;
       let objectStore = db
         .transaction("compgames", "readwrite")
@@ -48,7 +49,7 @@ export const CompgameStorage = {
 
   // obj: move and/or fen
   update: function(gameId, obj) {
-    dbOperation((err,db) => {
+    dbOperation((err, db) => {
       let objectStore = db
         .transaction("compgames", "readwrite")
         .objectStore("compgames");
@@ -69,7 +70,7 @@ export const CompgameStorage = {
   // Retrieve any game from its identifier (variant name)
   // NOTE: need callback because result is obtained asynchronously
   get: function(gameId, callback) {
-    dbOperation((err,db) => {
+    dbOperation((err, db) => {
       let objectStore = db
         .transaction("compgames", "readonly")
         .objectStore("compgames");
@@ -81,7 +82,7 @@ export const CompgameStorage = {
 
   // Delete a game in indexedDB
   remove: function(gameId) {
-    dbOperation((err,db) => {
+    dbOperation((err, db) => {
       if (!err) {
         db.transaction("compgames", "readwrite")
           .objectStore("compgames")