Skip to content

Commit

Permalink
Merge pull request #48 from metabolomics-us/QA
Browse files Browse the repository at this point in the history
Emergency Fix: SMILES Adding to File Even When Not Present on Upload File
  • Loading branch information
NolanGuzman97 committed Apr 22, 2022
2 parents 6fd330b + a6ede6e commit 00f3b13
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

import {NGXLogger} from 'ngx-logger';
import {Spectrum} from '../persistence/spectrum.resource';
import {MspParserLibService} from 'angular-msp-parser/dist/msp-parser-lib';
import {MgfParserLibService} from 'angular-mgf-parser/dist/mgf-parser-lib';
import {ChemifyService} from 'angular-cts-service/dist/cts-lib';
Expand Down Expand Up @@ -189,17 +188,17 @@ export class UploadLibraryService{
const myPromise = new Promise((resolve) => {
this.metadataOptimization.optimizeMetaData(spectra.meta).then((metaData: object) => {
const s = this.buildSpectrum();
if (spectra.id) {
if (typeof spectra.id !== 'undefined' && spectra.id !== null) {
s.id = spectra.id;
}
// assign structure information
if (spectra.inchiKey !== null) {
if (typeof spectra.inchiKey !== 'undefined' && spectra.inchiKey !== null) {
s.biologicalCompound.inchiKey = spectra.inchiKey;
}
if (spectra.inchi !== null) {
if (typeof spectra.inchi !== 'undefined' && spectra.inchi !== null) {
s.biologicalCompound.inchi = spectra.inchi;
}
if (spectra.smiles !== null) {
if (typeof spectra.smiles !== 'undefined' && spectra.smiles !== null) {
s.biologicalCompound.metaData.push({category: 'none', computed: false, hidden: false,
name: 'SMILES', value: spectra.smiles});
}
Expand Down

0 comments on commit 00f3b13

Please sign in to comment.