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