projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix README, TODO and a mistake in MyGames
[vchess.git]
/
client
/
src
/
utils
/
gameStorage.js
diff --git
a/client/src/utils/gameStorage.js
b/client/src/utils/gameStorage.js
index
dfbd639
..
480c73b
100644
(file)
--- a/
client/src/utils/gameStorage.js
+++ b/
client/src/utils/gameStorage.js
@@
-83,7
+83,9
@@
export const GameStorage = {
objectStore.get(gameId).onsuccess = function(event) {
// Ignoring error silently: shouldn't happen now. TODO?
if (event.target.result) {
objectStore.get(gameId).onsuccess = function(event) {
// Ignoring error silently: shouldn't happen now. TODO?
if (event.target.result) {
- const game = event.target.result;
+ let game = event.target.result;
+ // Hidden tabs are delayed, to prevent multi-updates:
+ if (obj.moveIdx < game.moves.length) return;
Object.keys(obj).forEach(k => {
if (k == "move") game.moves.push(obj[k]);
else game[k] = obj[k];
Object.keys(obj).forEach(k => {
if (k == "move") game.moves.push(obj[k]);
else game[k] = obj[k];