From 686e3513f59a19d42e67d9b11cd402cd86ace0b9 Mon Sep 17 00:00:00 2001 From: anvmn Date: Tue, 15 Oct 2024 19:55:21 +0300 Subject: [PATCH] Apply fix for PATCH as well --- client/src/js/nodes.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/js/nodes.js b/client/src/js/nodes.js index b41567df71..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,7 +344,7 @@ return addShard.then(function (json) { return table.put(json).catch(databaseError).then(function () { return sendRevisedNode(table, uuid).then(function () { - var tableName = table.name; + 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.