I have an alert that is displayed while a xhr download request is being processed, and another alert that is displayed when the download is ready. How do I do that ?
componentWillReceiveProps(nextProps) {
const { downloadStatus } = this.props;
if (!downloadStatus.isLoading && nextProps.downloadStatus.isLoading) {
this.props.alert.info('Download is loading...', { time: 0 });
} else if (downloadStatus.isLoading && !nextProps.downloadStatus.isLoading) {
// here i have to close info alert and show success
this.props.alert.success('Download is ready!', { time: 2000 });
}
}
I have an alert that is displayed while a xhr download request is being processed, and another alert that is displayed when the download is ready. How do I do that ?