Skip to content

Commit

Permalink
fix: queue logic
Browse files Browse the repository at this point in the history
fixes ussie  #11
  • Loading branch information
kukhariev committed Feb 27, 2019
1 parent 939764f commit 0f41f5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/uploadx/src/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class Uploader implements UploaderOptions {
reject(this);
} else {
this.URI = resolveUrl(location, this.options.endpoint);
this.status = 'queue' as UploadStatus;
this.status = 'uploading' as UploadStatus;
resolve(this);
}
} else {
Expand All @@ -140,9 +140,9 @@ export class Uploader implements UploaderOptions {
* Initiate upload
*/
async upload(item?: UploadItem) {
this.status = 'uploading' as UploadStatus;
try {
await this.create(item);
this.status = 'uploading' as UploadStatus;
if (this.progress) {
this.abort = this.sendChunk();
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/uploadx/src/uploadx.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
UploadStatus
} from './interfaces';
import { Uploader } from './uploader';

/**
*
*/
Expand Down Expand Up @@ -41,7 +42,7 @@ export class UploadxService {
uploadState.status === 'cancelled' ||
uploadState.status === 'error'
) {
this.autoUploadFiles();
this.processQueue();
}
});
}
Expand Down

0 comments on commit 0f41f5e

Please sign in to comment.