Skip to content

Commit

Permalink
fixed indents
Browse files Browse the repository at this point in the history
  • Loading branch information
retailify authored and jkuri committed Nov 9, 2017
1 parent d12aaca commit 3d900b6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 31 deletions.
4 changes: 2 additions & 2 deletions src/components/app-home/app-home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export class AppHomeComponent {
if (output.type === 'allAddedToQueue') {
const event: UploadInput = {
type: 'uploadAll',
url: 'http://ngx-uploader.com/upload',
method: 'POST',
url: 'http://ngx-uploader.com/upload',
method: 'POST',
data: { foo: 'bar' }
};

Expand Down
57 changes: 28 additions & 29 deletions src/ngx-uploader/classes/ngx-uploader.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ export class NgUploaderService {
let allowedIncomingFiles: File[] = [];

for (let i = 0; i < incomingFiles.length; i++) {
let checkFile = incomingFiles[i];
if (this.isContentTypeAllowed(checkFile.type)) {
allowedIncomingFiles.push(checkFile);
} else {
const rejectedFile: UploadFile = this.makeUploadFile(checkFile, i);
this.serviceEvents.emit({ type: 'rejected', file: rejectedFile });
}
let checkFile = incomingFiles[i];
if (this.isContentTypeAllowed(checkFile.type)) {
allowedIncomingFiles.push(checkFile);
} else {
const rejectedFile: UploadFile = this.makeUploadFile(checkFile, i);
this.serviceEvents.emit({ type: 'rejected', file: rejectedFile });
}
}

this.queue.push(...[].map.call(allowedIncomingFiles, (file: File, i: number) => {
Expand Down Expand Up @@ -262,33 +262,32 @@ export class NgUploaderService {
if (this.contentTypes.find((type: string) => type === mimetype ) !== undefined) {
return true;
}

return false;
}

private makeUploadFile(file: File, index: number): UploadFile {
return {
fileIndex: index,
id: this.generateId(),
name: file.name,
size: file.size,
type: file.type,
form: new FormData(),
progress: {
status: UploadStatus.Queue,
data: {
percentage: 0,
speed: 0,
speedHuman: `${humanizeBytes(0)}/s`,
startTime: null,
endTime: null,
eta: null,
etaHuman: null
}
},
lastModifiedDate: file.lastModifiedDate,
sub: undefined,
nativeFile: file
fileIndex: index,
id: this.generateId(),
name: file.name,
size: file.size,
type: file.type,
form: new FormData(),
progress: {
status: UploadStatus.Queue,
data: {
percentage: 0,
speed: 0,
speedHuman: `${humanizeBytes(0)}/s`,
startTime: null,
endTime: null,
eta: null,
etaHuman: null
}
},
lastModifiedDate: file.lastModifiedDate,
sub: undefined,
nativeFile: file
};
}
}

0 comments on commit 3d900b6

Please sign in to comment.