diff --git a/client/bower.json b/client/bower.json index a06be1fbb5..5c54df6bc3 100644 --- a/client/bower.json +++ b/client/bower.json @@ -13,7 +13,7 @@ "dependencies": { "copy-button": "sudodoki/copy-button#2.0.0", "dropzone": "5.7.0", - "dexie": "3.2.4", + "dexie": "3.2.7", "exif-js": "2.3.0", "semantic": "semantic-ui#2.2.1" } diff --git a/client/src/js/nodes.js b/client/src/js/nodes.js index 48dbd9146b..4abf179c80 100644 --- a/client/src/js/nodes.js +++ b/client/src/js/nodes.js @@ -246,7 +246,8 @@ // tables that may be altered due to a change. In this case // We want to allow adding pending upload photos. // See for example dbSync.nodeChanges.hook(). - return db.transaction('rw', table, dbSync.nodeChanges, dbSync.shardChanges, dbSync.authorityPhotoUploadChanges, function() { + var tableName = table.name; + return db.transaction('rw', tableName, dbSync.nodeChanges, dbSync.shardChanges, dbSync.authorityPhotoUploadChanges, function() { return table.get(uuid).catch(databaseError).then(function (node) { if (node) { var body = JSON.stringify({ @@ -274,7 +275,7 @@ var changeTable = dbSync.nodeChanges; var addShard = Promise.resolve(); - if (table === dbSync.shards) { + if (tableName === 'shards') { changeTable = dbSync.shardChanges; addShard = table.get(uuid).catch(databaseError).then(function (item) { @@ -343,11 +344,12 @@ return addShard.then(function (json) { return table.put(json).catch(databaseError).then(function () { return sendRevisedNode(table, uuid).then(function () { + var tableName = table.name; // For hooks to be able to work, we need to declare the // tables that may be altered due to a change. In this case // We want to allow adding pending upload photos. // See for example dbSync.nodeChanges.hook(). - return db.transaction('rw', table, dbSync.nodeChanges, dbSync.shardChanges, dbSync.authorityPhotoUploadChanges, function() { + return db.transaction('rw', tableName, dbSync.nodeChanges, dbSync.shardChanges, dbSync.authorityPhotoUploadChanges, function() { var body = JSON.stringify({ data: [json] }); @@ -372,7 +374,7 @@ var changeTable = dbSync.nodeChanges; - if (table === dbSync.shards) { + if (tableName === 'shards') { changeTable = dbSync.shardChanges; change.shard = json.shard; }