From 20b50b51e5b411f36b360ba0232b116043563d60 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Mon, 28 Oct 2024 15:35:12 -0700 Subject: [PATCH] fix data source picker for alerts card (#1149) Signed-off-by: Joanne Wang --- public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx b/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx index 00b2e395..77f9089c 100644 --- a/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx +++ b/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx @@ -49,7 +49,7 @@ export const DataSourceAlertsCard: React.FC = ({ get }, [dataSource]); const onDataSourceSelected = useCallback((options: any[]) => { - if (dataSource?.id !== undefined && dataSource?.id !== options[0]?.id) { + if (dataSource?.id === undefined || dataSource?.id !== options[0]?.id) { setDataSource(options[0]); } }, [dataSource]);