Skip to content

Commit 01c557c

Browse files
committed
getProjectStatus
1 parent 2014930 commit 01c557c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
410410

411411
resourcesList.forEach(study => {
412412
const state = study["state"];
413-
if (state && "shareState" in state && state["shareState"]["locked"] && state["shareState"]["status"] === "CLOSING") {
413+
const projectLocked = osparc.study.Utils.state.isProjectLocked(state);
414+
const projectStatus = osparc.study.Utils.state.getProjectStatus(state);
415+
if (projectLocked && projectStatus === "CLOSING") {
414416
// websocket might have already notified that the state was closed.
415417
// But the /projects calls response got after the ws message. Ask again to make sure
416418
const delay = 2000;

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,17 @@ qx.Class.define("osparc.study.Utils", {
375375
},
376376

377377
state: {
378+
getProjectStatus: function(state) {
379+
if (
380+
state &&
381+
"shareState" in state &&
382+
"status" in state["shareState"]
383+
) {
384+
return state["shareState"]["status"];
385+
}
386+
return null;
387+
},
388+
378389
isProjectLocked: function(state) {
379390
if (
380391
state &&

0 commit comments

Comments
 (0)