Skip to content

Commit

Permalink
Reverting some changes done just to test the workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Kshitij Tandon <tandonks@amazon.com>
  • Loading branch information
tandonks committed Oct 23, 2024
1 parent 31b4df7 commit 29a3cee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions public/pages/Main/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const LocalCluster: DataSourceOption = {
label: i18n.translate("dataSource.localCluster", {
defaultMessage: "Local cluster",
}),
id: "",
id: "Local",
};

export const dataSourceObservable = new BehaviorSubject<DataSourceOption>(LocalCluster);
Expand Down Expand Up @@ -231,7 +231,7 @@ export default class Main extends Component<MainProps, MainState> {
* 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
}

Expand Down Expand Up @@ -280,6 +280,10 @@ export default class Main extends Component<MainProps, MainState> {
}

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({
Expand Down

0 comments on commit 29a3cee

Please sign in to comment.