Group all update-UI functions together in file

This commit is contained in:
Angelo Stavrow 2020-08-02 08:43:24 -04:00
parent 288a5b18db
commit 3cb47afe65
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE
1 changed files with 8 additions and 6 deletions

View File

@ -163,6 +163,14 @@ private extension WebFeedInspectorViewController {
urlTextField?.stringValue = feed?.url ?? ""
}
func updateNotifyAboutNewArticles() {
isNotifyAboutNewArticlesCheckBox?.state = (feed?.isNotifyAboutNewArticles ?? false) ? .on : .off
}
func updateIsReaderViewAlwaysOn() {
isReaderViewAlwaysOnCheckBox?.state = (feed?.isArticleExtractorAlwaysOn ?? false) ? .on : .off
}
func updateNotificationSettings() {
UNUserNotificationCenter.current().getNotificationSettings { (settings) in
DispatchQueue.main.async {
@ -186,12 +194,6 @@ private extension WebFeedInspectorViewController {
NSWorkspace.shared.open(URL(fileURLWithPath: "x-apple.systempreferences:com.apple.preference"))
}
}
func updateNotifyAboutNewArticles() {
isNotifyAboutNewArticlesCheckBox?.state = (feed?.isNotifyAboutNewArticles ?? false) ? .on : .off
}
func updateIsReaderViewAlwaysOn() {
isReaderViewAlwaysOnCheckBox?.state = (feed?.isArticleExtractorAlwaysOn ?? false) ? .on : .off
}
}