X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Futils%2FgameStorage.js;h=ba189491835d65f94805af07ebc107b165dc305c;hp=59efb43af88338a05e523ef7d6f112d50194a256;hb=6b7b2cf720e6255e4da0dc34fee363c456346a58;hpb=f5a31ba0f98d215d432b7d3c86388af749df33a4 diff --git a/client/src/utils/gameStorage.js b/client/src/utils/gameStorage.js index 59efb43a..ba189491 100644 --- a/client/src/utils/gameStorage.js +++ b/client/src/utils/gameStorage.js @@ -83,8 +83,7 @@ export const GameStorage = { }, // Retrieve all local games (running, completed, imported...) - // light: do not retrieve moves or clocks (TODO: this is the only usage) - getAll: function(light, callback) { + getAll: function(callback) { dbOperation((err,db) => { let objectStore = db.transaction("games").objectStore("games"); let games = []; @@ -93,12 +92,11 @@ export const GameStorage = { // if there is still another cursor to go, keep running this code if (cursor) { let g = cursor.value; - if (light) { - g.movesCount = g.moves.length; - delete g.moves; - delete g.clocks; - delete g.initime; - } + // Do not retrieve moves or clocks (unused in list mode) + g.movesCount = g.moves.length; + delete g.moves; + delete g.clocks; + delete g.initime; games.push(g); cursor.continue(); } else callback(games);