Skip to content

Commit 9bf76df

Browse files
committed
stateReceived
1 parent 19e3cb3 commit 9bf76df

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@
1818
qx.Class.define("osparc.data.model.NodeLockState", {
1919
extend: qx.core.Object,
2020

21-
construct: function(lockState) {
21+
construct: function() {
2222
this.base(arguments);
2323

24-
this.set({
25-
currentUserGroupIds: lockState["current_user_groupids"] || [],
26-
locked: lockState["locked"] || false,
27-
status: lockState["status"] || "NOT_STARTED",
28-
});
24+
this.initCurrentUserGroupIds();
25+
this.initLocked();
26+
this.initStatus();
2927
},
3028

3129
properties: {
@@ -55,5 +53,15 @@ qx.Class.define("osparc.data.model.NodeLockState", {
5553
__currentUserGroupIds: function(currentUserGroupIds) {
5654
console.log(currentUserGroupIds);
5755
},
56+
57+
stateReceived: function(state) {
58+
if (state) {
59+
this.set({
60+
currentUserGroupIds: state.currentUserGroupIds || [],
61+
locked: state.locked || false,
62+
status: state.status || "NOT_STARTED",
63+
});
64+
}
65+
},
5866
}
5967
});

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,9 @@ qx.Class.define("osparc.data.model.NodeStatus", {
227227
this.setModified(null);
228228
}
229229
}
230+
console.log("NodeStatus.lock_state", state["lock_state"]);
230231
if ("lock_state" in state) {
231-
this.setLockState(state.lock_state);
232+
this.getLockState().stateReceived(state.lock_state);
232233
}
233234
},
234235

0 commit comments

Comments
 (0)