Fix main thread violation when opening Files app

This commit is contained in:
世界
2026-01-08 22:12:45 +08:00
parent b0f1eed827
commit 2419a798ab
@@ -218,7 +218,9 @@ public struct CoreView: View {
guard let sharedURL = URL(string: "shareddocuments://\(url.path)") else {
throw NSError(domain: "CoreView", code: 0, userInfo: [NSLocalizedDescriptionKey: "Failed to create shared documents URL"])
}
await UIApplication.shared.open(sharedURL)
await MainActor.run {
UIApplication.shared.open(sharedURL)
}
} catch {
await MainActor.run {
alert = AlertState(error: error)