Fix toggle bug

This commit is contained in:
Adria Navarro 2023-11-10 10:44:33 +01:00
parent 3f814c6a9b
commit 64c63e9e7f
1 changed files with 7 additions and 2 deletions

View File

@ -42,6 +42,7 @@
containsSelected,
dataSourceVisibility,
searchTerm,
onlyOneSource,
}) => {
if (searchTerm) {
return true
@ -51,6 +52,10 @@
return dataSourceVisibility
}
if (onlyOneSource) {
return true
}
return selected || containsSelected
}
@ -102,6 +107,7 @@
containsSelected,
dataSourceVisibility: dataSourcesVisibility[datasource._id],
searchTerm,
onlyOneSource: onlySource,
})
return {
...datasource,
@ -131,8 +137,7 @@
}
function toggleNode(datasource) {
dataSourcesVisibility[datasource._id] =
!dataSourcesVisibility[datasource._id]
dataSourcesVisibility[datasource._id] = !datasource.open
}
const containsActiveEntity = (