mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add Sidebar go to next functionality
This commit is contained in:
@@ -120,6 +120,12 @@ private extension SceneModel {
|
||||
|
||||
// MARK: Subscriptions
|
||||
func subscribeToToolbarChangeEvents() {
|
||||
NotificationCenter.default.publisher(for: .UnreadCountDidChange)
|
||||
.compactMap { $0.object as? AccountManager }
|
||||
.sink { [weak self] accountManager in
|
||||
self?.updateNextUnreadButtonState(accountManager: accountManager)
|
||||
}.store(in: &cancellables)
|
||||
|
||||
let combinedPublisher = timelineModel.$articles.combineLatest(timelineModel.$selectedArticles,
|
||||
NotificationCenter.default.publisher(for: .StatusesDidChange))
|
||||
|
||||
@@ -131,6 +137,14 @@ private extension SceneModel {
|
||||
|
||||
// MARK: Button State Updates
|
||||
|
||||
func updateNextUnreadButtonState(accountManager: AccountManager) {
|
||||
if accountManager.unreadCount > 0 {
|
||||
self.nextUnreadButtonState = false
|
||||
} else {
|
||||
self.nextUnreadButtonState = nil
|
||||
}
|
||||
}
|
||||
|
||||
func updateMarkAllAsReadButtonsState(articles: [Article]) {
|
||||
if articles.canMarkAllAsRead() {
|
||||
markAllAsReadButtonState = false
|
||||
|
||||
Reference in New Issue
Block a user