Only dispatch UI code for async execution

This commit is contained in:
Angelo Stavrow 2020-08-02 08:45:36 -04:00
parent 193aab2cef
commit 88ac27ef50
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -173,9 +173,9 @@ private extension WebFeedInspectorViewController {
func updateNotificationSettings() {
UNUserNotificationCenter.current().getNotificationSettings { (settings) in
DispatchQueue.main.async {
self.userNotificationSettings = settings
if settings.authorizationStatus == .authorized {
self.userNotificationSettings = settings
if settings.authorizationStatus == .authorized {
DispatchQueue.main.async {
NSApplication.shared.registerForRemoteNotifications()
}
}