From 3630056ed8ad7020299fb39e3f47651503460053 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Sat, 3 Dec 2022 21:44:33 +0000 Subject: [PATCH] Fix RED.nodes.clear() when handling locked flows --- .../node_modules/@node-red/editor-client/src/js/nodes.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/nodes.js b/packages/node_modules/@node-red/editor-client/src/js/nodes.js index cdaf0e00a..a7bfc1191 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/nodes.js +++ b/packages/node_modules/@node-red/editor-client/src/js/nodes.js @@ -2560,11 +2560,17 @@ RED.nodes = (function() { junctions = {}; junctionsByZ = {}; + var workspaceIds = Object.keys(workspaces); + // Ensure all workspaces are unlocked so we don't get any edit-protection + // preventing removal + workspaceIds.forEach(function(id) { + workspaces[id].locked = false + }); + var subflowIds = Object.keys(subflows); subflowIds.forEach(function(id) { RED.subflow.removeSubflow(id) }); - var workspaceIds = Object.keys(workspaces); workspaceIds.forEach(function(id) { RED.workspaces.remove(workspaces[id]); });