From fe09a54fd9ea9bb35514068ddb5c280ad895b809 Mon Sep 17 00:00:00 2001 From: Karthik Kumar A Date: Wed, 4 Oct 2017 20:40:00 +0530 Subject: [PATCH] Fix tslint issues --- src/ngx-uploader/classes/interfaces.ts | 3 ++- src/ngx-uploader/classes/ngx-uploader.class.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ngx-uploader/classes/interfaces.ts b/src/ngx-uploader/classes/interfaces.ts index 85e0978c..e9c5a99c 100644 --- a/src/ngx-uploader/classes/interfaces.ts +++ b/src/ngx-uploader/classes/interfaces.ts @@ -44,7 +44,8 @@ export interface UploadFile { } export interface UploadOutput { - type: 'addedToQueue' | 'allAddedToQueue' | 'uploading' | 'done' | 'start' | 'cancelled' | 'dragOver' | 'dragOut' | 'drop' | 'removed' | 'removedAll'; + type: 'addedToQueue' | 'allAddedToQueue' | 'uploading' | 'done' | 'start' | 'cancelled' | 'dragOver' + | 'dragOut' | 'drop' | 'removed' | 'removedAll'; file?: UploadFile; nativeFile?: File; } diff --git a/src/ngx-uploader/classes/ngx-uploader.class.ts b/src/ngx-uploader/classes/ngx-uploader.class.ts index e9c94adf..5e9da2ff 100644 --- a/src/ngx-uploader/classes/ngx-uploader.class.ts +++ b/src/ngx-uploader/classes/ngx-uploader.class.ts @@ -156,7 +156,7 @@ export class NgUploaderService { const headers = event.headers || {}; const xhr = new XMLHttpRequest(); - let time: number = new Date().getTime(); + const time: number = new Date().getTime(); let progressStartTime: number = (file.progress.data && file.progress.data.startTime) || time; let speed = 0; let eta: number | null = null; @@ -226,7 +226,7 @@ export class NgUploaderService { try { const uploadFile = file.nativeFile; - const uploadIndex = this.queue.findIndex(file => file.nativeFile === uploadFile); + const uploadIndex = this.queue.findIndex(outFile => outFile.nativeFile === uploadFile); if (this.queue[uploadIndex].progress.status === UploadStatus.Cancelled) { observer.complete();