iOS: Export log: Should present error from the main thread

This commit is contained in:
Roopesh Chander 2019-01-09 02:34:26 +05:30
parent 5cd3859b47
commit 2724a99733
1 changed files with 4 additions and 4 deletions

View File

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