Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.uploadService.fileDeleted.subscribe(objId => {
if (this.filesUploadingList) {
const file = this.filesUploadingList.find(item => {
return item.data.entry.id === objId;
});
if (file) {
file.status = FileUploadStatus.Cancelled;
this.changeDetector.detectChanges();
}
}
});
}
.subscribe(objId => {
if (this.filesUploadingList) {
const file = this.filesUploadingList.find((item) => {
return item.data.entry.id === objId;
});
if (file) {
file.status = FileUploadStatus.Cancelled;
this.changeDetector.detectChanges();
}
}
});
.subscribe(objId => {
if (this.filesUploadingList) {
const file = this.filesUploadingList.find((item) => {
return item.data.entry.id === objId;
});
if (file) {
file.status = FileUploadStatus.Cancelled;
this.changeDetector.detectChanges();
}
}
});
cancelFile(file: FileModel): void {
if (file.status === FileUploadStatus.Pending) {
file.status = FileUploadStatus.Cancelled;
} else {
this.uploadService.cancelUpload(file);
}
}
showCancelledStatus(): boolean {
return this.file.status === FileUploadStatus.Cancelled ||
this.file.status === FileUploadStatus.Aborted ||
this.file.status === FileUploadStatus.Deleted;
}
({ status }) =>
status === FileUploadStatus.Aborted ||
status === FileUploadStatus.Cancelled ||
status === FileUploadStatus.Deleted
)
cancelFile(file: FileModel): void {
if (file.status === FileUploadStatus.Pending) {
file.status = FileUploadStatus.Cancelled;
} else {
this.uploadService.cancelUpload(file);
}
}
({ status }) =>
status === FileUploadStatus.Aborted ||
status === FileUploadStatus.Cancelled ||
status === FileUploadStatus.Deleted
)