From 79245b38756e89ba983bf8edaee085a5dc01c6ba Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 28 Oct 2024 22:35:24 +0000 Subject: [PATCH] fix data source picker for alerts card (#1149) Signed-off-by: Joanne Wang (cherry picked from commit 20b50b51e5b411f36b360ba0232b116043563d60) Signed-off-by: github-actions[bot] --- 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]);