Skip to content

Commit

Permalink
fix: skipped first uploading event
Browse files Browse the repository at this point in the history
  • Loading branch information
kukhariev committed Mar 2, 2023
1 parent 7b10a8d commit 5182f95
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/uploadx/lib/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ export abstract class Uploader implements UploadState {
* Starts uploading
*/
async upload(): Promise<void> {
this._status = 'uploading';
while (this.status === 'uploading' || this.status === 'retry' || this.status === 'updated') {
do {
this.status = 'uploading';
try {
this._token ||= await this.updateToken();
Expand Down Expand Up @@ -174,7 +173,7 @@ export abstract class Uploader implements UploadState {
await this.retry.wait(this.getRetryAfterFromBackend());
}
}
}
} while (['uploading', 'retry', 'updated'].includes(this._status));
}

/**
Expand Down

0 comments on commit 5182f95

Please sign in to comment.