From 4a8366421f6193a86f95e6595c440842b96aab10 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Wed, 9 Jan 2019 02:34:26 +0530 Subject: iOS: Export log: Should present error from the main thread Signed-off-by: Roopesh Chander --- .../UI/iOS/ViewController/SettingsTableViewController.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift') diff --git a/WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift b/WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift index eced88d..64cd0f7 100644 --- a/WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift +++ b/WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift @@ -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 -- cgit v1.2.3-59-g8ed1b