X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Futils%2FimportgameStorage.js;h=bcda4fd25066f6bdc08f3e72f512e46e8ae393f5;hb=HEAD;hp=e5ad6e22f8de741c4a3bff2f438cdb583f3034ba;hpb=5f918a278904266a2a66a3c8e2a3655f37c2d2a7;p=vchess.git diff --git a/client/src/utils/importgameStorage.js b/client/src/utils/importgameStorage.js index e5ad6e22..bcda4fd2 100644 --- a/client/src/utils/importgameStorage.js +++ b/client/src/utils/importgameStorage.js @@ -33,6 +33,7 @@ function dbOperation(callback) { } export const ImportgameStorage = { + // Optional callback to get error status add: function(game, callback) { dbOperation((err, db) => { @@ -47,7 +48,7 @@ export const ImportgameStorage = { }; transaction.onerror = function(err) { // Duplicate key error (most likely) - callback(err); + callback(err.target.error); }; transaction.objectStore("importgames").add(game); }); @@ -110,4 +111,5 @@ export const ImportgameStorage = { } }); } + };