Commit fdc8636 1 parent 8a94a9b commit fdc8636 Copy full SHA for fdc8636
File tree 1 file changed +14
-8
lines changed
public/pages/DetectorsList/containers/List
1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -576,14 +576,20 @@ export const DetectorList = (props: ListProps) => {
576
576
} ) ;
577
577
} ;
578
578
579
- const handleDataSourceChange = ( e ) => {
580
- const dataConnectionId = e [ 0 ] ? e [ 0 ] . id : undefined ;
581
-
582
- setState ( {
583
- ...state ,
584
- page : 0 ,
585
- selectedDataSourceId : dataConnectionId ,
586
- } ) ;
579
+ const handleDataSourceChange = ( [ selectedDataSource ] ) => {
580
+ const dataSourceId = selectedDataSource ?. id ;
581
+
582
+ if ( ! dataSourceId ) {
583
+ core . notifications . toasts . addDanger (
584
+ prettifyErrorMessage ( 'Unable to set data source.' )
585
+ ) ;
586
+ } else {
587
+ setState ( ( prevState ) => ( {
588
+ ...prevState ,
589
+ page : 0 ,
590
+ selectedDataSourceId : dataSourceId ,
591
+ } ) ) ;
592
+ }
587
593
} ;
588
594
589
595
const getConfirmModal = ( ) => {
You can’t perform that action at this time.
0 commit comments