Fix bug that prevented Mark All As Read button from enabling until a status change event occurred

This commit is contained in:
Maurice Parker 2020-07-19 16:36:34 -05:00
parent fe2b81b47b
commit a521673ac6
1 changed files with 3 additions and 2 deletions

View File

@ -136,8 +136,9 @@ private extension SceneModel {
self?.updateNextUnreadButtonState(accountManager: accountManager)
}.store(in: &cancellables)
let combinedPublisher = timelineModel.$articles.combineLatest(timelineModel.$selectedArticles,
NotificationCenter.default.publisher(for: .StatusesDidChange))
let blankNotification = Notification(name: .StatusesDidChange)
let statusesDidChangePublisher = NotificationCenter.default.publisher(for: .StatusesDidChange).prepend(blankNotification)
let combinedPublisher = timelineModel.$articles.combineLatest(timelineModel.$selectedArticles, statusesDidChangePublisher)
combinedPublisher.sink { [weak self] (articles, selectedArticles, _) in
self?.updateMarkAllAsReadButtonsState(articles: articles)