Skip to content

Commit

Permalink
- fixed some bugs after the optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
boriskovar-m2ms committed Nov 5, 2020
1 parent 2f22205 commit 3acf88c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
5 changes: 5 additions & 0 deletions js/components/datasets/crossReferenceDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ export const CrossReferenceDialog = memo(
previousItemData={index > 0 && array[index - 1]}
nextItemData={index < array?.length && array[index + 1]}
removeOfAllSelectedTypes={removeOfAllSelectedTypes}
L={ligandList.includes(data.id)}
P={proteinList.includes(data.id)}
C={complexList.includes(data.id)}
S={false}
V={false}
/>
))}
{!(moleculeList.length > 0) && (
Expand Down
19 changes: 8 additions & 11 deletions js/components/datasets/datasetMoleculeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ export const DatasetMoleculeView = memo(
nextItemData,
removeOfAllSelectedTypes,
removeOfAllSelectedTypesOfInspirations,
moveSelectedMoleculeInspirationsSettings
moveSelectedMoleculeInspirationsSettings,
L, P, C, S, V
}) => {
const selectedAll = useRef(false);
const currentID = (data && data.id) || undefined;
Expand All @@ -261,10 +262,6 @@ export const DatasetMoleculeView = memo(
const dispatch = useDispatch();
const compoundsToBuyList = useSelector(state => state.datasetsReducers.compoundsToBuyDatasetMap[datasetID]);

const ligandList = useSelector(state => state.datasetsReducers.ligandLists[datasetID]);
const proteinList = useSelector(state => state.datasetsReducers.proteinLists[datasetID]);
const complexList = useSelector(state => state.datasetsReducers.complexLists[datasetID]);
const surfaceList = useSelector(state => state.datasetsReducers.surfaceLists[datasetID]);
const datasets = useSelector(state => state.datasetsReducers.datasets);
const filteredScoreProperties = useSelector(state => state.datasetsReducers.filteredScoreProperties);
const filter = useSelector(state => state.selectionReducers.filter);
Expand All @@ -280,10 +277,10 @@ export const DatasetMoleculeView = memo(
const { getNglView } = useContext(NglContext);
const stage = getNglView(VIEWS.MAJOR_VIEW) && getNglView(VIEWS.MAJOR_VIEW).stage;

const isLigandOn = (currentID && ligandList.includes(currentID)) || false;
const isProteinOn = (currentID && proteinList.includes(currentID)) || false;
const isComplexOn = (currentID && complexList.includes(currentID)) || false;
const isSurfaceOn = (currentID && surfaceList.includes(currentID)) || false;
const isLigandOn = L;
const isProteinOn = P;
const isComplexOn = C;
const isSurfaceOn = S;

const isCheckedToBuy = (currentID && compoundsToBuyList && compoundsToBuyList.includes(currentID)) || false;

Expand Down Expand Up @@ -339,10 +336,10 @@ export const DatasetMoleculeView = memo(
}
};
}, [
complexList,
C,
currentID,
data,
ligandList,
L,
imageHeight,
imageWidth,
data.smiles,
Expand Down
5 changes: 5 additions & 0 deletions js/components/datasets/inspirationDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,11 @@ export const InspirationDialog = memo(
previousItemData={index > 0 && array[index - 1]}
nextItemData={index < array?.length && array[index + 1]}
removeOfAllSelectedTypes={removeOfAllSelectedTypes}
L={ligandList.includes(molecule.id)}
P={proteinList.includes(molecule.id)}
C={complexList.includes(molecule.id)}
S={surfaceList.includes(molecule.id)}
V={vectorOnList.includes(molecule.id)}
/>
))}
{!(moleculeList.length > 0) && (
Expand Down

0 comments on commit 3acf88c

Please sign in to comment.