- add: function(game, callback)
- {
- dbOperation((db) => {
- let transaction = db.transaction("games", "readwrite");
- if (callback)
- {
- transaction.oncomplete = function() {
- callback({}); //everything's fine
- }
- transaction.onerror = function() {
- callback({errmsg: store.state.tr["Game retrieval failed:"] + " " + transaction.error});
- };
+ add: function(game, callback) {
+ dbOperation((err,db) => {
+ if (err) {
+ callback("error");
+ return;