Skip to content

Commit fabcc07

Browse files
committed
some progress
1 parent a09d586 commit fabcc07

File tree

1 file changed

+13
-5
lines changed
  • services/static-webserver/client/source/class/osparc/desktop

1 file changed

+13
-5
lines changed

services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,9 @@ qx.Class.define("osparc.desktop.StudyEditor", {
291291
if (!socket.slotExists("projectDocument:updated")) {
292292
socket.on("projectDocument:updated", data => {
293293
if (data["projectId"] === this.getStudy().getUuid()) {
294-
const currentStudy = this.getStudy().serialize();
295-
// the projectDocument doesn't contain the following properties
294+
const myStudy = this.getStudy().serialize();
295+
const updatedStudy = data["document"];
296+
// the updatedStudy model doesn't contain the following properties
296297
[
297298
"accessRights",
298299
"creationDate",
@@ -301,10 +302,17 @@ qx.Class.define("osparc.desktop.StudyEditor", {
301302
"tags",
302303
"trashedBy",
303304
].forEach(prop => {
304-
delete currentStudy[prop];
305+
delete myStudy[prop];
305306
});
306-
const delta = osparc.wrapper.JsonDiffPatch.getInstance().diff(currentStudy, data["document"]);
307-
console.log("projectDocument:updated delta", currentStudy, data["document"], delta);
307+
// ignore the ``state`` property, it has its own channel
308+
[
309+
"state",
310+
].forEach(prop => {
311+
delete updatedStudy[prop];
312+
});
313+
314+
const delta = osparc.wrapper.JsonDiffPatch.getInstance().diff(myStudy, updatedStudy);
315+
console.log("projectDocument:updated delta", myStudy, updatedStudy, delta);
308316
}
309317
}, this);
310318
}

0 commit comments

Comments
 (0)