javascript: fix the progress bar removal on success

When using auto-attach, the response HTML fragment replaces the progress
bar – so it doesn't need to be removed twice.
This commit is contained in:
Pierre de La Morinerie 2020-04-16 17:02:23 +02:00
parent 647ad3ba10
commit 769e98f63e

View file

@ -30,11 +30,12 @@ export default class Uploader {
if (this.autoAttachUrl) { if (this.autoAttachUrl) {
await this._attach(blobSignedId); await this._attach(blobSignedId);
// On response, the attachment HTML fragment will replace the progress bar.
} else {
this.progressBar.end();
this.progressBar.destroy();
} }
this.progressBar.end();
this.progressBar.destroy();
return blobSignedId; return blobSignedId;
} catch (error) { } catch (error) {
this.progressBar.error(error.message); this.progressBar.error(error.message);