diff --git a/js/components/datasets/crossReferenceDialog.js b/js/components/datasets/crossReferenceDialog.js index 9f719cc88..9fb04f523 100644 --- a/js/components/datasets/crossReferenceDialog.js +++ b/js/components/datasets/crossReferenceDialog.js @@ -228,141 +228,160 @@ export const CrossReferenceDialog = memo( moleculeList ); + if (anchorEl === null) { + dispatch(resetCrossReferenceDialog()); + } + return ( - - - dispatch(resetCrossReferenceDialog())} + <> + {anchorEl && anchorEl !== null && ( + <> + + + dispatch(resetCrossReferenceDialog())} + > + + + + ]} > - - - - ]} - > - {isLoadingCrossReferenceScores === false && moleculeList && ( - <> - - - {moleculeList.length > 0 && ( - - - - - - - - + {isLoadingCrossReferenceScores === false && moleculeList && ( + <> + + + {moleculeList.length > 0 && ( - + + + + + + + + + + + + + {/* C stands for contacts now */} + + + + - - - - {/* C stands for contacts now */} - - - + )} - )} - - -
- {moleculeList.length > 0 && - moleculeList.map((data, index, array) => { - let molecule = Object.assign({ isCrossReference: true }, data.molecule); - let previousData = index > 0 && Object.assign({ isCrossReference: true }, array[index - 1]); - let nextData = index < array?.length && Object.assign({ isCrossReference: true }, array[index + 1]); +
+ {moleculeList.length > 0 && + moleculeList.map((data, index, array) => { + let molecule = Object.assign({ isCrossReference: true }, data.molecule); + let previousData = index > 0 && Object.assign({ isCrossReference: true }, array[index - 1]); + let nextData = + index < array?.length && Object.assign({ isCrossReference: true }, array[index + 1]); - return ( - - ); - })} - {!(moleculeList.length > 0) && ( - + return ( + + ); + })} + {!(moleculeList.length > 0) && ( + + + No molecules found! + + + )} +
+ + )} + {isLoadingCrossReferenceScores === true && ( + - No molecules found! + )} -
- - )} - {isLoadingCrossReferenceScores === true && ( - - - - - - )} -
-
+ + + + )} + ); }) );