Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix clearing uploading status before upload success event #245

Merged
merged 2 commits into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/vaadin-upload/src/vaadin-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but this was easy to fix. The _createXhr method does not accept a parameter.


let stalledId, last;
// onprogress is called always after onreadystatechange
Expand Down Expand Up @@ -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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/vaadin-upload/test/upload.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down