From 8d3c5d09f695622bed0507299d0f5f7dd3501c90 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 20 Jul 2022 10:47:57 +0100 Subject: [PATCH] Do not flag hasUsers=false nodes as unused in search Fixes #3777 --- .../@node-red/editor-client/src/js/ui/search.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/search.js b/packages/node_modules/@node-red/editor-client/src/js/ui/search.js index 217fb5a4e..f9cc79f08 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/search.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/search.js @@ -187,7 +187,7 @@ RED.search = (function() { } if (flags.hasOwnProperty("unused")) { var isUnused = (node.node.type === 'subflow' && node.node.instances.length === 0) || - (isConfigNode && node.node.users.length === 0) + (isConfigNode && node.node.users.length === 0 && node.node._def.hasUsers !== false) if (flags.unused !== isUnused) { continue; } @@ -538,7 +538,7 @@ RED.search = (function() { $(previousActiveElement).trigger("focus"); } previousActiveElement = null; - } + } if(!keepSearchToolbar) { clearActiveSearch(); } @@ -630,7 +630,7 @@ RED.search = (function() { $("#red-ui-sidebar-shade").on('mousedown',hide); $("#red-ui-view-searchtools-close").on("click", function close() { - clearActiveSearch(); + clearActiveSearch(); updateSearchToolbar(); }); $("#red-ui-view-searchtools-close").trigger("click");