Fix main thread violation when opening Files app
This commit is contained in:
@@ -218,7 +218,9 @@ public struct CoreView: View {
|
|||||||
guard let sharedURL = URL(string: "shareddocuments://\(url.path)") else {
|
guard let sharedURL = URL(string: "shareddocuments://\(url.path)") else {
|
||||||
throw NSError(domain: "CoreView", code: 0, userInfo: [NSLocalizedDescriptionKey: "Failed to create shared documents URL"])
|
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 {
|
} catch {
|
||||||
await MainActor.run {
|
await MainActor.run {
|
||||||
alert = AlertState(error: error)
|
alert = AlertState(error: error)
|
||||||
|
|||||||
Reference in New Issue
Block a user