Skip to content

Commit

Permalink
feat: read jcamp raw data
Browse files Browse the repository at this point in the history
close #1481
  • Loading branch information
hamed-musallam committed Apr 21, 2022
1 parent 132afb1 commit def0ee8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/data/SpectraManager.ts
Expand Up @@ -143,10 +143,11 @@ export async function fromJSON(data: any[] = [], usedColors: any = {}) {
let promises: any[] = [];

for (let datum of data) {
if (datum?.source?.jcampURL != null) {
promises.push(
addJcampFromURL(spectra, datum.source.jcampURL, datum, usedColors),
);
const { jcamp, jcampURL } = datum?.source || {};
if (jcamp != null) {
addJcamp(spectra, jcamp, datum, usedColors);
} else if (jcampURL != null) {
promises.push(addJcampFromURL(spectra, jcampURL, datum, usedColors));
} else {
addData(spectra, datum, usedColors);
}
Expand Down

0 comments on commit def0ee8

Please sign in to comment.