Skip to content

Commit

Permalink
fix: uploading file with zero size
Browse files Browse the repository at this point in the history
  • Loading branch information
kukhariev committed Jul 19, 2019
1 parent 05210b7 commit 4b6c708
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"license": "MIT",
"private": true,
"scripts": {
"prettier": "prettier --write \"**/*.{json,scss,md,ts,html,component.html}\"",
"prettier": "prettier --write \"**/*.{json,scss,md,ts,html}\"",
"start": "ng serve",
"build:app": "ng build",
"test": "ng test --watch=false --progress=false",
Expand Down Expand Up @@ -88,7 +88,7 @@
}
},
"lint-staged": {
"*.{json,scss,md,ts,html,component.html}": [
"*.{json,scss,md,ts,html}": [
"prettier --write",
"git add"
]
Expand Down
2 changes: 1 addition & 1 deletion src/uploadx/src/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export abstract class Uploader implements UploadState {
while (this.status === 'uploading' || this.status === 'retry') {
try {
const offset = this.offset >= 0 ? await this.sendFileContent() : await this.getOffset();
if (offset === this.offset) {
if (this.size && offset === this.offset) {
throw new Error('Content upload failed');
}
this.retry.reset();
Expand Down

0 comments on commit 4b6c708

Please sign in to comment.