From 2419a798ab5797fbf12b193b97ca01dfa1c6aa30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 8 Jan 2026 19:15:31 +0800 Subject: [PATCH] Fix main thread violation when opening Files app --- ApplicationLibrary/Views/Setting/CoreView.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ApplicationLibrary/Views/Setting/CoreView.swift b/ApplicationLibrary/Views/Setting/CoreView.swift index 86e4e49..62acd62 100644 --- a/ApplicationLibrary/Views/Setting/CoreView.swift +++ b/ApplicationLibrary/Views/Setting/CoreView.swift @@ -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)