From 652280c2dd11e6fc566f30e96c94b90543952b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=88=AA=E5=AE=87?= <3364451258@qq.com> Date: Tue, 26 May 2026 22:41:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20AppShell=20=E6=8B=96=E6=8B=BD=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E7=94=A8=20TauriFile=20=E6=8E=A5=E5=8F=A3=E6=9B=BF?= =?UTF-8?q?=E4=BB=A3=20as=20any?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 --- src/components/layout/AppShell.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/layout/AppShell.tsx b/src/components/layout/AppShell.tsx index d15a28d..1cbd2ec 100644 --- a/src/components/layout/AppShell.tsx +++ b/src/components/layout/AppShell.tsx @@ -14,6 +14,11 @@ import { HelpDialog } from '@/components/dialogs/HelpDialog'; import { ImportDialog } from '@/components/dialogs/ImportDialog'; import { useAppActions, type DialogState } from '@/hooks/use-app-actions'; +/** Tauri's File object includes the native filesystem path */ +interface TauriFile extends File { + path: string; +} + export function AppShell() { const { t } = useTranslation(); const activeTab = useAppStore((s) => s.activeTab); @@ -92,8 +97,8 @@ export function AppShell() { for (let i = 0; i < e.dataTransfer.items.length; i++) { const entry = e.dataTransfer.items[i].webkitGetAsEntry(); if (entry?.isDirectory) { - const path = (e.dataTransfer.files[i] as any).path; - if (path) useAppStore.getState().addPath(path, activeTab === 'user' ? TargetType.USER : TargetType.SYSTEM); + const file = e.dataTransfer.files[i] as TauriFile; + if (file.path) useAppStore.getState().addPath(file.path, activeTab === 'user' ? TargetType.USER : TargetType.SYSTEM); } } }}