From 29a3cee14dcdb3094b696de86a1174bbcfd74180 Mon Sep 17 00:00:00 2001 From: Kshitij Tandon Date: Wed, 23 Oct 2024 13:10:52 +0530 Subject: [PATCH] Reverting some changes done just to test the workflows Signed-off-by: Kshitij Tandon --- public/pages/Main/Main.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/pages/Main/Main.tsx b/public/pages/Main/Main.tsx index ecd723a45..43013b4c1 100644 --- a/public/pages/Main/Main.tsx +++ b/public/pages/Main/Main.tsx @@ -198,7 +198,7 @@ const LocalCluster: DataSourceOption = { label: i18n.translate("dataSource.localCluster", { defaultMessage: "Local cluster", }), - id: "", + id: "Local", }; export const dataSourceObservable = new BehaviorSubject(LocalCluster); @@ -231,7 +231,7 @@ export default class Main extends Component { * empty string: using the local cluster. * string: using the selected data source. */ - dataSourceLoading: dataSourceId === undefined ? props.multiDataSourceEnabled : false, + dataSourceLoading: dataSourceId === undefined || dataSourceId === "Local" ? props.multiDataSourceEnabled : false, }; //Checking for dataSourceId to be Local to ensure that we set the dataSource once so that if no Local cluster present then it is set to default data source } @@ -280,6 +280,10 @@ export default class Main extends Component { } onSelectedDataSources = (dataSources: DataSourceOption[]) => { + if (dataSources.length == 0) { + //No datasource selected + return; + } const { id = "", label = "" } = dataSources[0] || {}; if (this.state.dataSourceId !== id || this.state.dataSourceLabel !== label) { this.setState({