From a31e68cdc467286e4b1ebbcc711eae7e48d7c5b5 Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Tue, 6 Sep 2022 11:49:51 +0300 Subject: [PATCH] UI: Refactoring --- ui-ngx/src/app/shared/components/file-input.component.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ui-ngx/src/app/shared/components/file-input.component.ts b/ui-ngx/src/app/shared/components/file-input.component.ts index c9f46d937c..deee44596c 100644 --- a/ui-ngx/src/app/shared/components/file-input.component.ts +++ b/ui-ngx/src/app/shared/components/file-input.component.ts @@ -192,11 +192,10 @@ export class FileInputComponent extends PageComponent implements AfterViewInit, if (!this.workFromFileObj) { fileContent = reader.result; if (fileContent && fileContent.length > 0) { - if (this.contentConvertFunction) { - fileContent = this.contentConvertFunction(fileContent); - } - fileName = file.name; - files = file.file; + if (this.contentConvertFunction) { + fileContent = this.contentConvertFunction(fileContent); + } + fileName = fileContent ? file.name : null; } } else if (file.name || file.file){ files = file.file;