From 64c63e9e7f0766b9df7710f178a41e58c5141381 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 10 Nov 2023 10:44:33 +0100 Subject: [PATCH] Fix toggle bug --- .../DatasourceNavigator/DatasourceNavigator.svelte | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte index c8eb946dd3..660710f0f1 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte @@ -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 = (