You can’t toggle an optional Bool
This commit is contained in:
parent
aa0a5d2269
commit
e88327be78
|
@ -114,6 +114,7 @@ extension SidebarViewController {
|
||||||
self.showNotificationsNotEnabledAlert()
|
self.showNotificationsNotEnabledAlert()
|
||||||
} else if settings.authorizationStatus == .authorized {
|
} else if settings.authorizationStatus == .authorized {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
|
if feed.isNotifyAboutNewArticles == nil { feed.isNotifyAboutNewArticles = false }
|
||||||
feed.isNotifyAboutNewArticles?.toggle()
|
feed.isNotifyAboutNewArticles?.toggle()
|
||||||
NotificationCenter.default.post(Notification(name: .DidUpdateFeedPreferencesFromContextMenu))
|
NotificationCenter.default.post(Notification(name: .DidUpdateFeedPreferencesFromContextMenu))
|
||||||
}
|
}
|
||||||
|
@ -121,6 +122,7 @@ extension SidebarViewController {
|
||||||
UNUserNotificationCenter.current().requestAuthorization(options: [.badge, .sound, .alert]) { (granted, error) in
|
UNUserNotificationCenter.current().requestAuthorization(options: [.badge, .sound, .alert]) { (granted, error) in
|
||||||
if granted {
|
if granted {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
|
if feed.isNotifyAboutNewArticles == nil { feed.isNotifyAboutNewArticles = false }
|
||||||
feed.isNotifyAboutNewArticles?.toggle()
|
feed.isNotifyAboutNewArticles?.toggle()
|
||||||
NotificationCenter.default.post(Notification(name: .DidUpdateFeedPreferencesFromContextMenu))
|
NotificationCenter.default.post(Notification(name: .DidUpdateFeedPreferencesFromContextMenu))
|
||||||
NSApplication.shared.registerForRemoteNotifications()
|
NSApplication.shared.registerForRemoteNotifications()
|
||||||
|
@ -138,6 +140,7 @@ extension SidebarViewController {
|
||||||
let feed = item.representedObject as? WebFeed else {
|
let feed = item.representedObject as? WebFeed else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if feed.isArticleExtractorAlwaysOn == nil { feed.isArticleExtractorAlwaysOn = false }
|
||||||
feed.isArticleExtractorAlwaysOn?.toggle()
|
feed.isArticleExtractorAlwaysOn?.toggle()
|
||||||
NotificationCenter.default.post(Notification(name: .DidUpdateFeedPreferencesFromContextMenu))
|
NotificationCenter.default.post(Notification(name: .DidUpdateFeedPreferencesFromContextMenu))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue