On the way to simplify : gameState + gameInfo everywhere = game
[vchess.git] / client / src / utils / storage.js
index 2c2d4be..eb04078 100644 (file)
@@ -137,7 +137,7 @@ export const GameStorage =
   // indexedDB:
   // Since DB requests are asynchronous, require a callback using the result
   // TODO: option for remote retrieval (third arg, or just "gameRef")
-  getLocal: function(callback, gameId)
+  getLocal: function(gameId, callback)
   {
     let games = [];
     dbOperation((db) => {
@@ -200,6 +200,6 @@ export const GameStorage =
     }
 
     // Game is local and not running
-    getLocal(callback, gid);
+    GameStorage.getLocal(gid, callback);
   },
 };