From e88327be787863da221990df0f30fcc66db4e1ca Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Tue, 2 Feb 2021 13:25:06 +0800 Subject: [PATCH] =?UTF-8?q?You=20can=E2=80=99t=20toggle=20an=20optional=20?= =?UTF-8?q?Bool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sidebar/SidebarViewController+ContextualMenus.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Mac/MainWindow/Sidebar/SidebarViewController+ContextualMenus.swift b/Mac/MainWindow/Sidebar/SidebarViewController+ContextualMenus.swift index d28fb85c1..e6861aa9c 100644 --- a/Mac/MainWindow/Sidebar/SidebarViewController+ContextualMenus.swift +++ b/Mac/MainWindow/Sidebar/SidebarViewController+ContextualMenus.swift @@ -114,6 +114,7 @@ extension SidebarViewController { self.showNotificationsNotEnabledAlert() } else if settings.authorizationStatus == .authorized { DispatchQueue.main.async { + if feed.isNotifyAboutNewArticles == nil { feed.isNotifyAboutNewArticles = false } feed.isNotifyAboutNewArticles?.toggle() NotificationCenter.default.post(Notification(name: .DidUpdateFeedPreferencesFromContextMenu)) } @@ -121,6 +122,7 @@ extension SidebarViewController { UNUserNotificationCenter.current().requestAuthorization(options: [.badge, .sound, .alert]) { (granted, error) in if granted { DispatchQueue.main.async { + if feed.isNotifyAboutNewArticles == nil { feed.isNotifyAboutNewArticles = false } feed.isNotifyAboutNewArticles?.toggle() NotificationCenter.default.post(Notification(name: .DidUpdateFeedPreferencesFromContextMenu)) NSApplication.shared.registerForRemoteNotifications() @@ -138,6 +140,7 @@ extension SidebarViewController { let feed = item.representedObject as? WebFeed else { return } + if feed.isArticleExtractorAlwaysOn == nil { feed.isArticleExtractorAlwaysOn = false } feed.isArticleExtractorAlwaysOn?.toggle() NotificationCenter.default.post(Notification(name: .DidUpdateFeedPreferencesFromContextMenu)) }