projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some fixes, work on Eightpieces draft, add a few capturing variants
[vchess.git]
/
client
/
src
/
utils
/
gameStorage.js
diff --git
a/client/src/utils/gameStorage.js
b/client/src/utils/gameStorage.js
index
59efb43
..
ba18949
100644
(file)
--- 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...)
},
// 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 = [];
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 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);
games.push(g);
cursor.continue();
} else callback(games);