.objectStore("compgames");
objectStore.get(gameId).onsuccess = function(event) {
// Ignoring error silently: shouldn't happen now. TODO?
- if (event.target.result) {
+ if (!!event.target.result) {
const game = event.target.result;
Object.keys(obj).forEach(k => {
if (k == "move") game.moves.push(obj[k]);
// obj: chat, move, fen, clocks, score[Msg], initime, ...
update: function(gameId, obj) {
- // live
dbOperation((err, db) => {
let objectStore = db
.transaction("games", "readwrite")
.objectStore("games");
objectStore.get(gameId).onsuccess = function(event) {
// Ignoring error silently: shouldn't happen now. TODO?
- if (event.target.result) {
+ if (!!event.target.result) {
let game = event.target.result;
// Hidden tabs are delayed, to prevent multi-updates:
if (obj.moveIdx < game.moves.length) return;