Skip to content

Commit

Permalink
- fixed some automatic merge problems
Browse files Browse the repository at this point in the history
  • Loading branch information
boriskovar-m2ms committed Dec 10, 2020
1 parent f1ee726 commit 2bb6a6f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions js/components/preview/molecule/moleculeList.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,20 @@ export const MoleculeList = memo(({ height, setFilterItemsHeight, filterItemsHei
}
}, [getJoinedMoleculeList, getAllMoleculeList, searchString]);

// Used for MoleculeListSortFilterDialog when using textSearch
const joinedMoleculeListsCopy = useMemo(() => [...joinedMoleculeLists], [joinedMoleculeLists]);
const addSelectedMoleculesFromUnselectedSites = useCallback((joinedMoleculeLists, list) => {
const result = [...joinedMoleculeLists];
list?.forEach(moleculeID => {
const foundJoinedMolecule = result.find(mol => mol.id === moleculeID);
if (!foundJoinedMolecule) {
const molecule = getAllMoleculeList.find(mol => mol.id === moleculeID);
if (molecule) {
result.push(molecule);
}
}
});

return result;
}, [getAllMoleculeList]);

joinedMoleculeLists = useMemo(
() => addSelectedMoleculesFromUnselectedSites(joinedMoleculeLists, proteinList),
Expand Down

0 comments on commit 2bb6a6f

Please sign in to comment.