mirror of https://github.com/node-red/node-red.git
Fix wrong unlock state when event is triggered
parent
a3c5b75368
commit
32540dd0e6
|
@ -589,6 +589,7 @@ RED.deploy = (function() {
|
|||
RED.notify('<p>' + RED._("deploy.successfulDeploy") + '</p>', "success");
|
||||
}
|
||||
const flowsToLock = new Set()
|
||||
// Node's properties cannot be modified if its workspace is locked.
|
||||
function ensureUnlocked(id) {
|
||||
const flow = id && (RED.nodes.workspace(id) || RED.nodes.subflow(id) || null);
|
||||
const isLocked = flow ? flow.locked : false;
|
||||
|
@ -645,6 +646,9 @@ RED.deploy = (function() {
|
|||
RED.nodes.eachSubflow(function (subflow) {
|
||||
if (subflow.changed) {
|
||||
subflow.changed = false;
|
||||
if (flowsToLock.has(subflow)) {
|
||||
subflow.locked = true;
|
||||
}
|
||||
RED.events.emit("subflows:change", subflow);
|
||||
}
|
||||
});
|
||||
|
@ -653,9 +657,13 @@ RED.deploy = (function() {
|
|||
ensureUnlocked(ws.z)
|
||||
ws.changed = false;
|
||||
delete ws.added
|
||||
if (flowsToLock.has(ws)) {
|
||||
ws.locked = true;
|
||||
}
|
||||
RED.events.emit("flows:change", ws)
|
||||
}
|
||||
});
|
||||
// Ensures all workspaces/subflows to be locked have been locked.
|
||||
flowsToLock.forEach(flow => {
|
||||
flow.locked = true
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue