Skip to content

Commit 88af3aa

Browse files
committed
safety measures
1 parent 67327d3 commit 88af3aa

File tree

1 file changed

+9
-0
lines changed
  • services/static-webserver/client/source/class/osparc/data/model

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,12 @@ qx.Class.define("osparc.data.model.Workbench", {
878878
__removeNodesFromPatches: function(nodesRemoved, workbenchPatchesByNode) {
879879
nodesRemoved.forEach(nodeId => {
880880
const node = this.getNode(nodeId);
881+
882+
// if the user is in that node, restore the node to the workbench
883+
if (this.getStudy().getUi().getCurrentNodeId() === nodeId) {
884+
this.getStudy().setMode("pipeline");
885+
this.getStudy().getUi().setCurrentNodeId(null);
886+
}
881887
if (node) {
882888
node.nodeRemoved(nodeId);
883889
}
@@ -887,6 +893,9 @@ qx.Class.define("osparc.data.model.Workbench", {
887893
},
888894

889895
__addNodesFromPatches: function(nodesAdded, workbenchPatchesByNode) {
896+
// not solved yet, reload the site to avoid issues
897+
window.location.reload();
898+
890899
// this is an async operation with an await
891900
const promises = nodesAdded.map(nodeId => {
892901
const nodeData = workbenchPatchesByNode[nodeId][0].value;

0 commit comments

Comments
 (0)