}
export const CompgameStorage = {
+
add: function(game) {
dbOperation((err, db) => {
if (err) return;
.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]);
}
});
}
+
};