From: Benjamin Auder Date: Fri, 31 May 2019 16:52:00 +0000 (+0200) Subject: On the way to simplify : gameState + gameInfo everywhere = game X-Git-Url: https://git.auder.net/%7B%7B%20asset%28%27mixstore/css/user/doc/html/left.jpg?a=commitdiff_plain;h=d6c1bf3726afae94867854dda76df2848770068c;p=vchess.git On the way to simplify : gameState + gameInfo everywhere = game --- diff --git a/client/src/components/ComputerGame.vue b/client/src/components/ComputerGame.vue index 5ecc1a65..5196e542 100644 --- a/client/src/components/ComputerGame.vue +++ b/client/src/components/ComputerGame.vue @@ -10,6 +10,10 @@ import BaseGame from "@/components/BaseGame.vue"; import { store } from "@/store"; import Worker from 'worker-loader!@/playCompMove'; + +// TODO: simplify, just "game" and "gameInfo" prop (fen+mode+vname may change at the same time) + + export default { name: 'my-computer-game', components: { diff --git a/client/src/utils/storage.js b/client/src/utils/storage.js index 2c2d4be2..eb040781 100644 --- a/client/src/utils/storage.js +++ b/client/src/utils/storage.js @@ -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); }, }; diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 7a99ef9b..3a2f03a5 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -16,7 +16,7 @@ pareil quand quelqu'un reco.