Skip to content

Commit

Permalink
Drop legacy async call on retry upload
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan committed Jan 23, 2018
1 parent 50191a1 commit 5e2bb97
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion test/upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,23 @@
upload._uploadFile(file);
});

it('should fire the `upload-retry` event on retrying', done => {
upload.addEventListener('upload-retry', e => {
Polymer.Base.async(() => {
expect(file.uploading).to.be.ok;
done();
}, 100);
});
upload._retryFileUpload(file);
});

it('should propagate with-credentials to the xhr', done => {
upload.withCredentials = true;
upload.addEventListener('upload-start', e => {
e.preventDefault();
expect(e.detail.xhr.withCredentials).to.be.true;
done();
});
});
upload._uploadFile(file);
});

Expand Down
3 changes: 2 additions & 1 deletion vaadin-upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<link rel="import" href="../polymer/polymer-element.html">
<link rel="import" href="../polymer/lib/elements/dom-repeat.html">
<link rel="import" href="../../polymer/lib/utils/async.html">
<link rel="import" href="../vaadin-themable-mixin/vaadin-themable-mixin.html">
<link rel="import" href="../vaadin-button/vaadin-button.html">
<link rel="import" href="vaadin-upload-icons.html">
Expand Down Expand Up @@ -685,7 +686,7 @@
})
);
if (evt) {
this.async(this._uploadFile.bind(this, file));
Polymer.Async.microTask.run(this._uploadFile.bind(this, file));
}
}

Expand Down

0 comments on commit 5e2bb97

Please sign in to comment.