update: function(gameId, obj) {
if (Number.isInteger(gameId) || !isNaN(parseInt(gameId))) {
// corr: only move, fen and score
-console.log(obj.move);
ajax("/games", "PUT", {
gid: gameId,
newObj: {
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];