Ensure 'hidden flow' count doesn't include subflows

Fixes #3707
This commit is contained in:
Nick O'Leary 2022-06-27 20:30:14 +01:00
parent dd0d1e700e
commit 7af3acde9e
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 15 additions and 2 deletions

View File

@ -284,9 +284,22 @@ RED.workspaces = (function() {
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({
label: RED._("workspace.hiddenFlows",{count: hideStack.length}),
label: RED._("workspace.hiddenFlows",{count: flowCount}),
onselect: "core:list-hidden-flows"
})
}