Skip to content

Commit 680e748

Browse files
committed
openStudy
1 parent dc988a9 commit 680e748

File tree

2 files changed

+18
-11
lines changed
  • services/static-webserver/client/source/class/osparc

2 files changed

+18
-11
lines changed

services/static-webserver/client/source/class/osparc/data/model/Study.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -587,21 +587,14 @@ qx.Class.define("osparc.data.model.Study", {
587587
if ("disableServiceAutoStart" in this.getDev()) {
588588
return this.getDev()["disableServiceAutoStart"];
589589
}
590-
return null;
590+
return false;
591591
},
592592

593593
openStudy: function() {
594-
const params = {
595-
url: {
596-
"studyId": this.getUuid()
597-
},
598-
data: osparc.utils.Utils.getClientSessionID()
599-
};
600-
if (this.getDisableServiceAutoStart() !== null) {
601-
params["url"]["disableServiceAutoStart"] = this.getDisableServiceAutoStart();
602-
return osparc.data.Resources.fetch("studies", "openDisableAutoStart", params);
594+
if (this.getDisableServiceAutoStart()) {
595+
return osparc.store.Study.getInstance().openStudy(this.getUuid(), false);
603596
}
604-
return osparc.data.Resources.fetch("studies", "open", params);
597+
return osparc.store.Study.getInstance().openStudy(this.getUuid());
605598
},
606599

607600
stopStudy: function() {

services/static-webserver/client/source/class/osparc/store/Study.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,20 @@ qx.Class.define("osparc.store.Study", {
6363
return osparc.data.Resources.fetch("studies", "getOne", params)
6464
},
6565

66+
openStudy: function(studyId, autoStart = true) {
67+
const params = {
68+
url: {
69+
studyId,
70+
},
71+
data: osparc.utils.Utils.getClientSessionID()
72+
};
73+
if (autoStart) {
74+
return osparc.data.Resources.fetch("studies", "open", params);
75+
}
76+
params["url"]["disableServiceAutoStart"] = true;
77+
return osparc.data.Resources.fetch("studies", "openDisableAutoStart", params);
78+
},
79+
6680
createStudy: function(studyData) {
6781
const params = {
6882
data: studyData

0 commit comments

Comments
 (0)