Skip to content

Commit f71c76c

Browse files
committed
eventDrivenPatch
1 parent ec4b52b commit f71c76c

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,10 @@ qx.Class.define("osparc.desktop.StudyEditor", {
152152
.then(studyData => {
153153
this.__setStudyDataInBackend(studyData);
154154

155-
study.listenToChanges();
156-
study.addListener("updateStudyDocument", e => this.updateStudyDocument(e.getData()), this);
155+
if (osparc.utils.Utils.eventDrivenPatch()) {
156+
study.listenToChanges();
157+
study.addListener("updateStudyDocument", e => this.updateStudyDocument(e.getData()), this);
158+
}
157159

158160
this.__workbenchView.setStudy(study);
159161
this.__slideshowView.setStudy(study);
@@ -806,6 +808,11 @@ qx.Class.define("osparc.desktop.StudyEditor", {
806808

807809
// ------------------ AUTO SAVER ------------------
808810
__startAutoSaveTimer: function() {
811+
if (osparc.utils.Utils.eventDrivenPatch()) {
812+
// If event driven patch is enabled, auto save is not needed
813+
return;
814+
}
815+
809816
// Save every 3 seconds
810817
const timer = this.__autoSaveTimer = new qx.event.Timer(this.self().AUTO_SAVE_INTERVAL);
811818
timer.addListener("interval", () => {
@@ -833,6 +840,11 @@ qx.Class.define("osparc.desktop.StudyEditor", {
833840

834841
// ---------------- SAVING TIMER ------------------
835842
__startSavingTimer: function() {
843+
if (osparc.utils.Utils.eventDrivenPatch()) {
844+
// If event driven patch is enabled, saving timer indicator is not needed
845+
return;
846+
}
847+
836848
const timer = this.__savingTimer = new qx.event.Timer(this.self().DIFF_CHECK_INTERVAL);
837849
timer.addListener("interval", () => {
838850
if (!osparc.wrapper.WebSocket.getInstance().isConnected()) {
@@ -903,7 +915,7 @@ qx.Class.define("osparc.desktop.StudyEditor", {
903915
}
904916

905917
if (osparc.utils.Utils.isDevelopmentPlatform()) {
906-
console.log("updateStudyDocument", data); // For debugging purposes
918+
console.log("updateStudyDocument", data || "forced"); // For debugging purposes
907919
}
908920

909921
this.__updatingStudy++;

services/static-webserver/client/source/class/osparc/utils/Utils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,10 @@ qx.Class.define("osparc.utils.Utils", {
496496
return (["dev", "master"].includes(platformName));
497497
},
498498

499+
eventDrivenPatch: function() {
500+
return true;
501+
},
502+
499503
getEditButton: function(isVisible = true) {
500504
return new qx.ui.form.Button(null, "@FontAwesome5Solid/pencil-alt/12").set({
501505
appearance: "form-button-outlined",

0 commit comments

Comments
 (0)