From d1a1702040a7cc8773a8b56116bc0f59d3ee7849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20I=C3=9Fbr=C3=BCcker?= Date: Wed, 21 Apr 2021 17:45:48 +0200 Subject: [PATCH 1/2] fix: fix clearing uploading status before upload success event --- packages/vaadin-upload/src/vaadin-upload.js | 1 - packages/vaadin-upload/test/upload.test.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/vaadin-upload/src/vaadin-upload.js b/packages/vaadin-upload/src/vaadin-upload.js index eb1dbb20d9..967ad82c12 100644 --- a/packages/vaadin-upload/src/vaadin-upload.js +++ b/packages/vaadin-upload/src/vaadin-upload.js @@ -610,7 +610,6 @@ class UploadElement extends ElementMixin(ThemableMixin(PolymerElement)) { } else { file.loadedStr = file.totalStr; file.status = this.i18n.uploading.status.processing; - file.uploading = false; } } diff --git a/packages/vaadin-upload/test/upload.test.js b/packages/vaadin-upload/test/upload.test.js index 6ebeb2751c..3d38a22eeb 100644 --- a/packages/vaadin-upload/test/upload.test.js +++ b/packages/vaadin-upload/test/upload.test.js @@ -88,7 +88,7 @@ describe('upload', () => { expect(f.loaded).to.be.equal(100000); expect(f.size).to.be.equal(100000); expect(f.speed).to.be.gt(100); - expect(f.uploading).not.to.be.ok; + expect(f.uploading).to.be.ok; }); it('should fire the upload-success', async () => { From 1030f6b70ac4aca1758cc23d2b9551c5db101dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20I=C3=9Fbr=C3=BCcker?= Date: Wed, 21 Apr 2021 18:28:50 +0200 Subject: [PATCH 2/2] Cleanup _createXhr call --- packages/vaadin-upload/src/vaadin-upload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vaadin-upload/src/vaadin-upload.js b/packages/vaadin-upload/src/vaadin-upload.js index 967ad82c12..fff3d2729d 100644 --- a/packages/vaadin-upload/src/vaadin-upload.js +++ b/packages/vaadin-upload/src/vaadin-upload.js @@ -582,7 +582,7 @@ class UploadElement extends ElementMixin(ThemableMixin(PolymerElement)) { } const ini = Date.now(); - const xhr = (file.xhr = this._createXhr(file)); + const xhr = (file.xhr = this._createXhr()); let stalledId, last; // onprogress is called always after onreadystatechange