Skip to content

Commit 6368946

Browse files
authored
🐛 Frontend: pageContext property might not be yet initialized (#4496)
1 parent a17cbea commit 6368946

File tree

1 file changed

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

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,15 @@ qx.Class.define("osparc.desktop.StudyEditor", {
220220
this.__workbenchView.openFirstNode();
221221
break;
222222
}
223-
this.bind("pageContext", study.getUi(), "mode");
223+
// the property might not be yet initialized
224+
if (this.isPropertyInitialized("pageContext")) {
225+
this.bind("pageContext", study.getUi(), "mode");
226+
} else {
227+
this.addListener("changePageContext", e => {
228+
const pageCxt = e.getData();
229+
study.getUi().setMode(pageCxt);
230+
});
231+
}
224232

225233
const workbench = study.getWorkbench();
226234
workbench.addListener("retrieveInputs", e => {

0 commit comments

Comments
 (0)