|
|
@ -106,8 +106,16 @@ class ImportDialog extends React.Component<PropsType> {
|
|
|
|
// XXX: implement handling of rejectedFiles
|
|
|
|
// XXX: implement handling of rejectedFiles
|
|
|
|
const reader = new FileReader();
|
|
|
|
const reader = new FileReader();
|
|
|
|
|
|
|
|
|
|
|
|
reader.onabort = () => alert('file reading was aborted');
|
|
|
|
reader.onabort = () => {
|
|
|
|
reader.onerror = () => alert('file reading has failed');
|
|
|
|
this.setState({ loading: false });
|
|
|
|
|
|
|
|
console.error('Import Aborted');
|
|
|
|
|
|
|
|
alert('file reading was aborted');
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
reader.onerror = (e) => {
|
|
|
|
|
|
|
|
this.setState({ loading: false });
|
|
|
|
|
|
|
|
console.error(e);
|
|
|
|
|
|
|
|
alert('file reading has failed');
|
|
|
|
|
|
|
|
};
|
|
|
|
reader.onload = () => {
|
|
|
|
reader.onload = () => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const fileText = reader.result as string;
|
|
|
|
const fileText = reader.result as string;
|
|
|
|