Skip to content

Commit 877394b

Browse files
authored
Merge pull request #574 from Steinbeck-Lab/development
fix: Change to new InChI molecular inorganics version;
2 parents ac44bf4 + dfb5da9 commit 877394b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

frontend/src/components/tools/InChIView.jsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const InChIOptions = ({ onChange, inchiVersion, setInchiVersion }) => {
4747
const [t15, setT15] = useState(false);
4848
const [polymers, setPolymers] = useState(false);
4949
const [NPZz, setNPZz] = useState(false);
50-
const [orgMet, setOrgMet] = useState(inchiVersion === "1.07.3-orgmet");
50+
const [molecularInorganics, setMolecularInorganics] = useState(inchiVersion === "1.07.3-orgmet");
5151
const [showTautomerism, setShowTautomerism] = useState(true); // Add state for tautomerism visibility
5252

5353
// Additional stereo options
@@ -111,8 +111,8 @@ const InChIOptions = ({ onChange, inchiVersion, setInchiVersion }) => {
111111

112112
if (NPZz) options.push("NPZz");
113113

114-
// orgMet is only available in the 1.07.3-orgmet version
115-
if (orgMet && inchiVersion === "1.07.3-orgmet") options.push("OrgMet");
114+
// molecularInorganics is only available in the 1.07.3-orgmet version
115+
if (molecularInorganics && inchiVersion === "1.07.3-orgmet") options.push("MolecularInorganics");
116116

117117
// Format the options string as required by the API
118118
const optionsString = options.map((opt) => `-${opt}`).join(" ");
@@ -126,7 +126,7 @@ const InChIOptions = ({ onChange, inchiVersion, setInchiVersion }) => {
126126
t15,
127127
polymers,
128128
NPZz,
129-
orgMet,
129+
molecularInorganics,
130130
SUU,
131131
SLUUD,
132132
NEWPSOFF,
@@ -143,14 +143,14 @@ const InChIOptions = ({ onChange, inchiVersion, setInchiVersion }) => {
143143
onChange,
144144
]);
145145

146-
// Update OrgMet option when InChI version changes
146+
// Update MolecularInorganics option when InChI version changes
147147
useEffect(() => {
148148
if (inchiVersion === "1.07.3-orgmet") {
149-
setOrgMet(true); // Enable orgMet when switching to 1.07.3-orgmet
150-
} else if (orgMet) {
151-
setOrgMet(false); // Disable orgMet when switching away from 1.07.3-orgmet
149+
setMolecularInorganics(true); // Enable MolecularInorganics when switching to 1.07.3-orgmet
150+
} else if (molecularInorganics) {
151+
setMolecularInorganics(false); // Disable MolecularInorganics when switching away from 1.07.3-orgmet
152152
}
153-
}, [inchiVersion, orgMet]);
153+
}, [inchiVersion, molecularInorganics]);
154154

155155
// Update polymer-related options when polymers toggle changes
156156
useEffect(() => {
@@ -171,7 +171,7 @@ const InChIOptions = ({ onChange, inchiVersion, setInchiVersion }) => {
171171
setT15(false);
172172
setPolymers(false);
173173
setNPZz(false);
174-
setOrgMet(inchiVersion === "1.07.3-orgmet" ? true : false);
174+
setMolecularInorganics(inchiVersion === "1.07.3-orgmet" ? true : false);
175175
setSUU(false);
176176
setSLUUD(false);
177177
setNEWPSOFF(false);
@@ -666,14 +666,14 @@ const InChIOptions = ({ onChange, inchiVersion, setInchiVersion }) => {
666666
{inchiVersion === "1.07.3-orgmet" && (
667667
<div className="flex items-center border-t border-gray-200 dark:border-gray-700 pt-3">
668668
<input
669-
id="orgmet"
669+
id="molecularInorganics"
670670
type="checkbox"
671-
checked={orgMet}
672-
onChange={(e) => setOrgMet(e.target.checked)}
671+
checked={molecularInorganics}
672+
onChange={(e) => setMolecularInorganics(e.target.checked)}
673673
className="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded"
674674
/>
675675
<label
676-
htmlFor="orgmet"
676+
htmlFor="molecularInorganics"
677677
className="ml-2 block text-sm text-gray-700 dark:text-gray-300"
678678
>
679679
Molecular inorganics

0 commit comments

Comments
 (0)