]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
iOS: Export log: Should present error from the main thread
authorRoopesh Chander <roop@roopc.net>
Tue, 8 Jan 2019 21:04:26 +0000 (02:34 +0530)
committerRoopesh Chander <roop@roopc.net>
Mon, 14 Jan 2019 09:22:35 +0000 (14:52 +0530)
Signed-off-by: Roopesh Chander <roop@roopc.net>
WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift

index eced88d676c62b567a3a32661dbe0d4bff239512..64cd0f7dfe989530a5335e2e481d8e55d342c241 100644 (file)
@@ -129,12 +129,12 @@ class SettingsTableViewController: UITableViewController {
             }
 
             let isWritten = Logger.global?.writeLog(called: "APP", mergedWith: networkExtensionLogFilePath, called: "NET", to: destinationURL.path) ?? false
-            guard isWritten else {
-                ErrorPresenter.showErrorAlert(title: tr("alertUnableToWriteLogTitle"), message: tr("alertUnableToWriteLogMessage"), from: self)
-                return
-            }
 
             DispatchQueue.main.async {
+                guard isWritten else {
+                    ErrorPresenter.showErrorAlert(title: tr("alertUnableToWriteLogTitle"), message: tr("alertUnableToWriteLogMessage"), from: self)
+                    return
+                }
                 let activityVC = UIActivityViewController(activityItems: [destinationURL], applicationActivities: nil)
                 activityVC.popoverPresentationController?.sourceView = sourceView
                 activityVC.popoverPresentationController?.sourceRect = sourceView.bounds