Skip to content

Commit

Permalink
fix data source picker for alerts card (#1149) (#1150)
Browse files Browse the repository at this point in the history
(cherry picked from commit 20b50b5)

Signed-off-by: Joanne Wang <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent aab2f66 commit 21271a6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const DataSourceAlertsCard: React.FC<DataSourceAlertsCardProps> = ({ 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]);
Expand Down

0 comments on commit 21271a6

Please sign in to comment.