Browse Source

Merge pull request #7211 from ArtemDzhereleiko/AD/bug-fix/file-input

[3.4.2] UI: Fixed file input loader
pull/7236/head
Igor Kulikov 4 years ago
committed by GitHub
parent
commit
66bdf4b7eb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      ui-ngx/src/app/shared/components/file-input.component.ts

18
ui-ngx/src/app/shared/components/file-input.component.ts

@ -188,20 +188,18 @@ export class FileInputComponent extends PageComponent implements AfterViewInit,
let fileName = null;
let fileContent = null;
let files = null;
if (typeof reader.result === 'string') {
fileContent = reader.result;
if (fileContent && fileContent.length > 0) {
if (!this.workFromFileObj) {
if (reader.readyState === reader.DONE) {
if (!this.workFromFileObj) {
fileContent = reader.result;
if (fileContent && fileContent.length > 0) {
if (this.contentConvertFunction) {
fileContent = this.contentConvertFunction(fileContent);
}
if (fileContent) {
fileName = file.name;
}
} else {
files = file.file;
fileName = file.name;
fileName = fileContent ? file.name : null;
}
} else if (file.name || file.file){
files = file.file;
fileName = file.name;
}
}
resolve({fileContent, fileName, files});

Loading…
Cancel
Save