From 459c8d44520d4d683049d862835997dcca87bf64 Mon Sep 17 00:00:00 2001 From: Maksym Tsymbarov Date: Wed, 29 Apr 2026 14:32:15 +0200 Subject: [PATCH] Types fix --- ui-ngx/src/app/shared/components/file-input.component.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 3a309a97ac..5b09c30c25 100644 --- a/ui-ngx/src/app/shared/components/file-input.component.ts +++ b/ui-ngx/src/app/shared/components/file-input.component.ts @@ -215,6 +215,7 @@ export class FileInputComponent extends PageComponent implements AfterViewInit, }); return; } + const reader = new FileReader(); reader.onload = () => { let fileName = null; @@ -235,7 +236,6 @@ export class FileInputComponent extends PageComponent implements AfterViewInit, reader.onerror = () => { resolve({fileContent: null, fileName: null, files: null, mediaType: null}); }; - if (this.readAsBinary) { reader.readAsBinaryString(file.file); } else { @@ -249,11 +249,12 @@ export class FileInputComponent extends PageComponent implements AfterViewInit, } Object.defineProperty(reader, 'readyState', {value: FileReader.DONE, configurable: true}); Object.defineProperty(reader, 'result', {value: text, configurable: true}); - reader.onload(new ProgressEvent('load')); - }).catch(() => reader.onerror(new ProgressEvent('error'))); + reader.onload(new ProgressEvent('load') as ProgressEvent); + }).catch(() => reader.onerror(new ProgressEvent('error') as ProgressEvent)); } }); } + private checkMaxSize(file: flowjs.FlowFile): boolean { return !this.maxSizeByte || file.size <= this.maxSizeByte; }