Skip to content

Commit 7e8a618

Browse files
refactor: remove map spectra
1 parent 1dfece8 commit 7e8a618

3 files changed

Lines changed: 1 addition & 31 deletions

File tree

src/NMRiumWrapper.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { useLoadSpectra } from './hooks/useLoadSpectra';
77
import { usePreferences } from './hooks/usePreferences';
88
import { useWhiteList } from './hooks/useWhiteList';
99
import AboutUsModal from './modal/AboutUsModal';
10-
import { mapSpectra } from './utilities/mapSpectra';
1110

1211
const styles: Record<'container' | 'loadingContainer', CSSProperties> = {
1312
container: {
@@ -40,9 +39,6 @@ export default function NMRiumWrapper() {
4039

4140
const { workspace, preferences, defaultEmptyMessage } = usePreferences();
4241
const dataChangeHandler = useCallback<NMRiumChangeCb>((state, source) => {
43-
//TODO: remove map spectra once this issue resolved
44-
//a temporary fix by remove the `logger` and `keepSource` objects from each spectrum, this should removed once we solve the issue in nmr-load-save
45-
state.data.spectra = mapSpectra(state.data.spectra);
4642
events.trigger('data-change', {
4743
state,
4844
source,

src/hooks/useLoadSpectra.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { useCallback, useMemo, useState } from 'react';
1111
import events from '../events';
1212
import { getFileNameFromURL } from '../utilities/getFileNameFromURL';
1313
import { isArrayOfString } from '../utilities/isArrayOfString';
14-
import { mapSpectra } from '../utilities/mapSpectra';
1514

1615
const PARSING_OPTIONS: Partial<ParsingOptions> = {
1716
onLoadProcessing: { autoProcessing: true },
@@ -24,10 +23,7 @@ async function loadSpectraFromFiles(files: File[]) {
2423
const {
2524
nmriumState: { data },
2625
} = await read(fileCollection, PARSING_OPTIONS);
27-
//TODO: remove map spectra once this issue resolved
28-
//a temporary fix by remove the `logger` and `keepSource` objects from each spectrum, this should removed once we solve the issue in nmr-load-save
29-
const mapData = { ...data, spectra: mapSpectra(data?.spectra) };
30-
return mapData;
26+
return data;
3127
}
3228

3329
async function loadSpectraFromURLs(urls: string[]) {
@@ -43,11 +39,6 @@ async function loadSpectraFromURLs(urls: string[]) {
4339
}, []);
4440

4541
const { data } = await readFromWebSource({ entries }, PARSING_OPTIONS);
46-
//TODO: remove map spectra once this issue resolved
47-
//a temporary fix by remove the `logger` and `keepSource` objects from each spectrum, this should removed once we solve the issue in nmr-load-save
48-
const mapData = { ...data, spectra: mapSpectra(data?.spectra) };
49-
return mapData;
50-
5142
return data;
5243
}
5344

src/utilities/mapSpectra.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)