From b7472fcdaa69145ab1e66198ea4dd131624922f8 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 3 Apr 2020 20:07:38 -0500 Subject: [PATCH] Remove duplicate remote notification registration. --- Mac/AppDelegate.swift | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index 3edb0d1a6..96a278b52 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -231,13 +231,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, refreshTimer = AccountRefreshTimer() syncTimer = ArticleStatusSyncTimer() - UNUserNotificationCenter.current().requestAuthorization(options:[.badge, .sound, .alert]) { (granted, error) in - if granted { - DispatchQueue.main.async { - NSApplication.shared.registerForRemoteNotifications() - } - } - } + UNUserNotificationCenter.current().requestAuthorization(options:[.badge, .sound, .alert]) { (granted, error) in } + NSApplication.shared.registerForRemoteNotifications() UNUserNotificationCenter.current().delegate = self userNotificationManager = UserNotificationManager() @@ -268,7 +263,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, } #endif - NSApplication.shared.registerForRemoteNotifications() } func application(_ application: NSApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([NSUserActivityRestoring]) -> Void) -> Bool {