cheminfo / nmrium

React component to display and process nuclear magnetic resonance (NMR) spectra.
https://docs.nmrium.org
MIT License
55 stars 25 forks source link

Display message if unknown extension when dropping file #94

Closed lpatiny closed 5 years ago

hamed-musallam commented 5 years ago

@lpatiny I show this message if the dropped file extension not one of ( .dx,.jdx,.json,.mol ) "The file must be jcamp file .dx,.jdx,.json file extension

lpatiny commented 5 years ago

.dx was not allowed but I added in the commit a6727aee00d68134d97ce4dfb6b41ee9e0ad1712

I think also the way the code is done currently it can never throw an error for unknown extensions because you only call loadFiles for known extensions !

Please change the code so that the rejection is done in the case default behaviour that seems more logical to me: https://github.com/cheminfo/nmr-displayer/blob/a6727aee00d68134d97ce4dfb6b41ee9e0ad1712/src/component/NMRDisplayer.jsx#L199