Skip to content

Commit 7ba392b

Browse files
committed
not needed anymore
1 parent ffd604e commit 7ba392b

File tree

1 file changed

+1
-76
lines changed
  • services/static-webserver/client/source/class/osparc/desktop

1 file changed

+1
-76
lines changed

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

Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ qx.Class.define("osparc.desktop.StudyEditor", {
155155
__viewsStack: null,
156156
__workbenchView: null,
157157
__slideshowView: null,
158-
__autoSaveTimer: null,
159-
__savingTimer: null,
160158
__studyEditorIdlingTracker: null,
161159
__lastSyncedProjectDocument: null,
162160
__lastSyncedProjectVersion: null,
@@ -267,10 +265,7 @@ qx.Class.define("osparc.desktop.StudyEditor", {
267265
}
268266
}
269267

270-
if (osparc.data.model.Study.canIWrite(study.getAccessRights())) {
271-
this.__startAutoSaveTimer();
272-
this.__startSavingTimer();
273-
} else {
268+
if (!osparc.data.model.Study.canIWrite(study.getAccessRights())) {
274269
const msg = this.self().READ_ONLY_TEXT;
275270
osparc.FlashMessenger.logAs(msg, "WARNING");
276271
}
@@ -953,67 +948,8 @@ qx.Class.define("osparc.desktop.StudyEditor", {
953948
},
954949
// ------------------ IDLING TRACKER ------------------
955950

956-
// ------------------ AUTO SAVER ------------------
957-
__startAutoSaveTimer: function() {
958-
if (osparc.utils.Utils.eventDrivenPatch()) {
959-
// If event driven patch is enabled, auto save is not needed
960-
return;
961-
}
962-
963-
// Save every 3 seconds
964-
const timer = this.__autoSaveTimer = new qx.event.Timer(this.self().AUTO_SAVE_INTERVAL);
965-
timer.addListener("interval", () => {
966-
if (!osparc.wrapper.WebSocket.getInstance().isConnected()) {
967-
return;
968-
}
969-
this.__checkStudyChanges();
970-
}, this);
971-
timer.start();
972-
},
973-
974-
__stopAutoSaveTimer: function() {
975-
if (this.__autoSaveTimer && this.__autoSaveTimer.isEnabled()) {
976-
this.__autoSaveTimer.stop();
977-
this.__autoSaveTimer.setEnabled(false);
978-
}
979-
},
980-
981-
__restartAutoSaveTimer: function() {
982-
if (this.__autoSaveTimer && this.__autoSaveTimer.isEnabled()) {
983-
this.__autoSaveTimer.restart();
984-
}
985-
},
986-
// ------------------ AUTO SAVER ------------------
987-
988-
// ---------------- SAVING TIMER ------------------
989-
__startSavingTimer: function() {
990-
if (osparc.utils.Utils.eventDrivenPatch()) {
991-
// If event driven patch is enabled, saving timer indicator is not needed
992-
return;
993-
}
994-
995-
const timer = this.__savingTimer = new qx.event.Timer(this.self().DIFF_CHECK_INTERVAL);
996-
timer.addListener("interval", () => {
997-
if (!osparc.wrapper.WebSocket.getInstance().isConnected()) {
998-
return;
999-
}
1000-
this.getStudy().setSavePending(this.didStudyChange());
1001-
}, this);
1002-
timer.start();
1003-
},
1004-
1005-
__stopSavingTimer: function() {
1006-
if (this.__savingTimer && this.__savingTimer.isEnabled()) {
1007-
this.__savingTimer.stop();
1008-
this.__savingTimer.setEnabled(false);
1009-
}
1010-
},
1011-
// ---------------- SAVING TIMER ------------------
1012-
1013951
__stopTimers: function() {
1014952
this.__stopIdlingTracker();
1015-
this.__stopAutoSaveTimer();
1016-
this.__stopSavingTimer();
1017953
},
1018954

1019955
__getStudyDiffs: function() {
@@ -1040,17 +976,6 @@ qx.Class.define("osparc.desktop.StudyEditor", {
1040976
return changed;
1041977
},
1042978

1043-
__checkStudyChanges: function() {
1044-
if (this.didStudyChange()) {
1045-
if (this.__updatingStudy > 0) {
1046-
// throttle update
1047-
this.__updateThrottled = true;
1048-
} else {
1049-
this.updateStudyDocument();
1050-
}
1051-
}
1052-
},
1053-
1054979
/**
1055980
* @param {JSON Patch} data It will soon be used to patch the project document https://datatracker.ietf.org/doc/html/rfc6902
1056981
*/

0 commit comments

Comments
 (0)