Fix background issue

This commit is contained in:
Max Goedjen 2021-05-09 19:58:55 -07:00
parent af479408a4
commit ef3f38f4c1
No known key found for this signature in database
GPG Key ID: E58C21DD77B9B8E8
1 changed files with 3 additions and 1 deletions

View File

@ -23,7 +23,9 @@ struct LaunchAgentController {
Logger().debug("Agent is not running, attempting to force launch")
let url = Bundle.main.bundleURL.appendingPathComponent("Contents/Library/LoginItems/SecretAgent.app")
NSWorkspace.shared.openApplication(at: url, configuration: NSWorkspace.OpenConfiguration()) { app, error in
completion?(error == nil)
DispatchQueue.main.async {
completion?(error == nil)
}
if let error = error {
Logger().error("Error force launching \(error.localizedDescription)")
} else {