Browse Source

MOS-20 Force to main queue the uninstallMenuExtra function.

MOS-20
David Alarcon 1 year ago
parent
commit
f41c4a9f35
1 changed files with 10 additions and 15 deletions
  1. +10
    -15
      Submodules/pEpNotifications/pEpNotifications/AppDelegate.swift

+ 10
- 15
Submodules/pEpNotifications/pEpNotifications/AppDelegate.swift View File

@ -184,8 +184,11 @@ extension AppDelegate {
return
}
NSStatusBar.system.removeStatusItem(barItem)
statusBarItem = nil
DispatchQueue.main.async { [weak self] in
guard let me = self else { return }
NSStatusBar.system.removeStatusItem(barItem)
me.statusBarItem = nil
}
}
}
@ -231,7 +234,7 @@ extension AppDelegate: PEPNotificationProtocol {
nc.deliver(un)
product.notification = un
}
downloadStateNotifier.notify(.NewVersionAvailable(String(withName)), with: product)
case .noDownloadAvailable:
@ -287,15 +290,12 @@ extension AppDelegate: NSUserNotificationCenterDelegate {
return
}
DispatchQueue.main.async { [weak self] in
guard let me = self else { return }
me.uninstallMenuExtra()
}
let filename : String = didActivate.userInfo?["filename"] as! String
NSLog("pEpNotifications: actionButtonClicked for %@", filename)
NSWorkspace.shared.openFile(filename)
downloadStateNotifier.notify(.Connected)
uninstallMenuExtra()
}
}
@ -317,15 +317,10 @@ extension AppDelegate: NSXPCListenerDelegate {
extension AppDelegate: DownloadNotificationManagerDelegate {
func installSelected(with product: Product) {
defer {
DispatchQueue.main.async { [weak self] in
guard let me = self else { return }
me.uninstallMenuExtra()
}
}
NSLog("pEpNotifications: actionButtonClicked for %@", product.filename)
NSWorkspace.shared.openFile(product.filename)
downloadStateNotifier.notify(.Connected)
uninstallMenuExtra()
}
}

Loading…
Cancel
Save