Skip to content

Commit

Permalink
Merge pull request #304 from cnotin/patch-1
Browse files Browse the repository at this point in the history
Shows persistent info alert when processing file, and at end of processing
  • Loading branch information
rvazarkar authored Feb 24, 2020
2 parents f5fdf3b + 96957d2 commit f4df98e
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/components/Menu/MenuContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class MenuContainer extends Component {
if (file.zip_name) {
msg += " from {}".format(file.zip_name);
}
this.props.alert.info(
msg
this.alert = this.props.alert.info(
msg, { timeout: 0 }
);
this.getFileMeta(file.path, callback);
},
Expand All @@ -62,6 +62,7 @@ class MenuContainer extends Component {
unlinkSync(file.path);
}
});
this.props.alert.info('Finished processing all files', { timeout: 0 });
}
);
});
Expand Down Expand Up @@ -127,8 +128,8 @@ class MenuContainer extends Component {
if (file.zip_name) {
msg += " from {}".format(file.zip_name);
}
this.props.alert.info(
msg
this.alert = this.props.alert.info(
msg, { timeout: 0 }
);
this.getFileMeta(file.path, callback);
},
Expand All @@ -142,6 +143,7 @@ class MenuContainer extends Component {
unlinkSync(file.path);
}
});
this.props.alert.info('Finished processing all files', { timeout: 0 });
}
);

Expand Down Expand Up @@ -185,11 +187,11 @@ class MenuContainer extends Component {
var path = files[index].path;
var name = files[index].name;

this.props.alert.info(
'Unzipping file {}'.format(name)
);

if (isZipSync(path)) {
var alert = this.props.alert.info(
'Unzipping file {}'.format(name)
);

await createReadStream(path)
.pipe(Parse())
.on('error', function(error) {
Expand Down Expand Up @@ -217,6 +219,7 @@ class MenuContainer extends Component {
});
})
.promise();
alert.close();
} else {
processed.push({ path: path, name: name, delete: false });
}
Expand Down Expand Up @@ -329,6 +332,9 @@ class MenuContainer extends Component {
this.setState({ progress: 100 });
emitter.emit('refreshDBData');
console.timeEnd('IngestTime');
if (this.alert) { // close currently shown info alert
this.alert.close();
}
callback();
}.bind(this)
);
Expand Down

0 comments on commit f4df98e

Please sign in to comment.