From d26ef5f18c0902931bca14ebda65c301f1b1a42d Mon Sep 17 00:00:00 2001 From: "Yuanqi(Ella) Zhu" Date: Wed, 3 Apr 2024 17:36:35 +0000 Subject: [PATCH] fix syntax Signed-off-by: Yuanqi(Ella) Zhu --- .../data_source_management/public/components/utils.ts | 9 ++++----- src/plugins/dev_tools/public/application.tsx | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/plugins/data_source_management/public/components/utils.ts b/src/plugins/data_source_management/public/components/utils.ts index eebf7316e3e3..2044b039e71e 100644 --- a/src/plugins/data_source_management/public/components/utils.ts +++ b/src/plugins/data_source_management/public/components/utils.ts @@ -110,8 +110,8 @@ export function getDefaultDataSource( label: defaultOption?.[0]?.label || defaultOptionDataSource.attributes?.title, }, ]; -} -if (defaultDataSourceAfterCheck) { + } + if (defaultDataSourceAfterCheck) { return [ { id: defaultDataSourceAfterCheck.id, @@ -121,9 +121,8 @@ if (defaultDataSourceAfterCheck) { } if (!hideLocalCluster) { return [LocalCluster]; - } - return []; - + } + return []; } export async function getDataSourceById( diff --git a/src/plugins/dev_tools/public/application.tsx b/src/plugins/dev_tools/public/application.tsx index a8048f920c98..ebd70960ba1e 100644 --- a/src/plugins/dev_tools/public/application.tsx +++ b/src/plugins/dev_tools/public/application.tsx @@ -77,7 +77,7 @@ function DevToolsWrapper({ uiSettings, }: DevToolsWrapperProps) { const mountedTool = useRef(null); - const [isLoading, setIsLoading] = React.useState(false); + const [isLoading, setIsLoading] = React.useState(true); useEffect( () => () => { @@ -114,7 +114,7 @@ function DevToolsWrapper({ mountpoint: mountPoint, unmountHandler, }; - setIsLoading(true); + setIsLoading(false); }; return ( @@ -135,7 +135,7 @@ function DevToolsWrapper({ ))} - {dataSourceEnabled && isLoading ? ( + {dataSourceEnabled && !isLoading ? (