From 2987f96389b23487883185c1d9e01990b4a99283 Mon Sep 17 00:00:00 2001 From: Andrii Rodzyk Date: Mon, 23 Mar 2026 17:56:47 +0200 Subject: [PATCH] feat(file-change): enhance file selection handling for launchQueue integration fix(index): add mobile-web-app-capable meta tag and remove google-site-verification --- .../ui/file-change/file-change.component.ts | 29 ++++++++++++++----- src/index.html | 2 +- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/app/shared/ui/file-change/file-change.component.ts b/src/app/shared/ui/file-change/file-change.component.ts index 40fb673..cdbf4b5 100644 --- a/src/app/shared/ui/file-change/file-change.component.ts +++ b/src/app/shared/ui/file-change/file-change.component.ts @@ -5,6 +5,11 @@ import { FILE_PATH } from '../../../app-routing.module'; import { LangService } from '../../data-access/lang.service'; import { isPlatformServer } from '@angular/common'; +type LaunchParams = { + files: FileSystemHandle[]; + targetURL: string +} + @Component({ selector: 'app-file-change', templateUrl: './file-change.component.html', @@ -29,14 +34,22 @@ export class FileChangeComponent implements OnInit { this.initFileInput(); if ("launchQueue" in window) { - (window as any).launchQueue.setConsumer(async (launchParams: FileSystemFileHandle) => { - console.log((launchParams as any).files[0]); - - const file: File = await launchParams.getFile(); - console.log("FileSystemFileHandle.getFile() ->", file) - console.log("FileSystemFileHandle", launchParams) - // const file: File = (launchParams as any).files[0] as File; - this.fileHandler(file) + (window as any).launchQueue.setConsumer(async (launchParams: LaunchParams) => { + + if (!launchParams.files?.length) return; + + for (const handle of launchParams.files) { + + if (handle.kind === "file") { + const fileHandle = handle as FileSystemFileHandle; + console.log("fileHandle", fileHandle) + const file = await fileHandle.getFile(); + console.log("File:", file.name); + + this.fileHandler(file); + return; + } + } }); } } diff --git a/src/index.html b/src/index.html index fac7f4e..320a99b 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,7 @@ + -