@@ -254,20 +254,24 @@ export const getFilteredDatasetMoleculeList = createSelector(
254
254
for ( let prioAttr of sortedAttributes ) {
255
255
const order = filterProperties [ prioAttr ] . order ;
256
256
257
- const scoreValueOfA = Object . keys ( a . numerical_scores ) . find ( key => key === prioAttr ) && a . numerical_scores [ prioAttr ] ;
258
- scoreValueOfA = scoreValueOfA || ( Object . keys ( a . text_scores ) . find ( key => key === prioAttr ) && a . text_scores [ prioAttr ] ) ;
259
- const scoreValueOfB = Object . keys ( b . numerical_scores ) . find ( key => key === prioAttr ) && b . numerical_scores [ prioAttr ] ;
260
- scoreValueOfB = scoreValueOfB || ( Object . keys ( b . text_scores ) . find ( key => key === prioAttr ) && b . text_scores [ prioAttr ] ) ;
261
-
262
- if ( scoreValueOfA === "Y" ) {
257
+ const scoreValueOfA =
258
+ Object . keys ( a . numerical_scores ) . find ( key => key === prioAttr ) && a . numerical_scores [ prioAttr ] ;
259
+ scoreValueOfA =
260
+ scoreValueOfA || ( Object . keys ( a . text_scores ) . find ( key => key === prioAttr ) && a . text_scores [ prioAttr ] ) ;
261
+ const scoreValueOfB =
262
+ Object . keys ( b . numerical_scores ) . find ( key => key === prioAttr ) && b . numerical_scores [ prioAttr ] ;
263
+ scoreValueOfB =
264
+ scoreValueOfB || ( Object . keys ( b . text_scores ) . find ( key => key === prioAttr ) && b . text_scores [ prioAttr ] ) ;
265
+
266
+ if ( scoreValueOfA === 'Y' ) {
263
267
scoreValueOfA = 1 ;
264
- } else if ( scoreValueOfA === "N" ) {
268
+ } else if ( scoreValueOfA === 'N' ) {
265
269
scoreValueOfA = 0 ;
266
270
}
267
271
268
- if ( scoreValueOfB === "Y" ) {
272
+ if ( scoreValueOfB === 'Y' ) {
269
273
scoreValueOfB = 1 ;
270
- } else if ( scoreValueOfB === "N" ) {
274
+ } else if ( scoreValueOfB === 'N' ) {
271
275
scoreValueOfB = 0 ;
272
276
}
273
277
@@ -314,7 +318,10 @@ export const getCrossReferenceCompoundListByCompoundName = createSelector(
314
318
Object . keys ( moleculesDatasetMap ) . forEach ( datasetID => {
315
319
const currentList = moleculesDatasetMap [ datasetID ] ;
316
320
if ( currentList && Array . isArray ( currentList ) ) {
317
- results . push ( { molecule : currentList . find ( item => item . name === compoundName ) , datasetID } ) ;
321
+ let molecule = currentList . find ( item => item . name === compoundName ) ;
322
+ if ( molecule ) {
323
+ results . push ( { molecule, datasetID } ) ;
324
+ }
318
325
}
319
326
} ) ;
320
327
return results ;
0 commit comments