mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Prevent deleting subflow if instance on locked tab
This commit is contained in:
parent
ce94226c3c
commit
fe9c630572
@ -616,7 +616,7 @@ RED.nodes = (function() {
|
||||
var subflowId = n.type.substring(8);
|
||||
var sf = RED.nodes.subflow(subflowId);
|
||||
if (sf) {
|
||||
sf.instances.push(sf);
|
||||
sf.instances.push(newNode);
|
||||
}
|
||||
n["_"] = RED._;
|
||||
}
|
||||
|
@ -450,6 +450,9 @@ RED.subflow = (function() {
|
||||
return
|
||||
}
|
||||
if (subflow.instances.length > 0) {
|
||||
if (subflow.instances.some(sf => { const ws = RED.nodes.workspace(sf.z); return ws?ws.locked:false })) {
|
||||
return
|
||||
}
|
||||
const msg = $('<div>')
|
||||
$('<p>').text(RED._("subflow.subflowInstances",{count: subflow.instances.length})).appendTo(msg);
|
||||
$('<p>').text(RED._("subflow.confirmDelete")).appendTo(msg);
|
||||
|
Loading…
Reference in New Issue
Block a user