1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge pull request #3823 from Steve-Mcl/backport-3715

Ensure 'hidden flow' count doesn't include subflows (backport to v2.x)
This commit is contained in:
Nick O'Leary 2022-08-04 12:58:49 +01:00 committed by GitHub
commit 970be7b5f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -281,9 +281,22 @@ RED.workspaces = (function() {
onselect: "core:show-last-hidden-flow" onselect: "core:show-last-hidden-flow"
} }
] ]
if (hideStack.length > 0) { let hiddenFlows = new Set()
for (let i = 0; i < hideStack.length; i++) {
let ids = hideStack[i]
if (!Array.isArray(ids)) {
ids = [ids]
}
ids.forEach(id => {
if (RED.nodes.workspace(id)) {
hiddenFlows.add(id)
}
})
}
const flowCount = hiddenFlows.size;
if (flowCount > 0) {
menuItems.unshift({ menuItems.unshift({
label: RED._("workspace.hiddenFlows",{count: hideStack.length}), label: RED._("workspace.hiddenFlows",{count: flowCount}),
onselect: "core:list-hidden-flows" onselect: "core:list-hidden-flows"
}) })
} }