Skip to content

Commit

Permalink
fix: manual option of changing an integral sum not selected in the ex…
Browse files Browse the repository at this point in the history
…ercise mode

close #1397
  • Loading branch information
hamed-musallam committed Mar 3, 2022
1 parent 0a51dd5 commit 70640e9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/component/modal/changeSum/ChangeSumModal.tsx
Expand Up @@ -105,7 +105,11 @@ export default function ChangeSumModal({
}, []);

useEffect(() => {
if (sumOptions.sumAuto) {
if (
sumOptions.sumAuto &&
!general.hideSetSumFromMolecule &&
!panels.hideStructuresPanel
) {
setActiveOption(SumSetOptions.Auto);
const { mf, moleculeKey: key } = sumOptions;
formRef.current.setValues({
Expand All @@ -116,7 +120,7 @@ export default function ChangeSumModal({
setActiveOption(SumSetOptions.Manual);
formRef.current.setValues({ sum: sumOptions.sum, molecule: null });
}
}, [sumOptions]);
}, [general.hideSetSumFromMolecule, panels.hideStructuresPanel, sumOptions]);

const saveHandler = useCallback(
(values) => {
Expand Down

0 comments on commit 70640e9

Please sign in to comment.