From a521673ac6438bf24a98d8db0d2d25c6601b8e8a Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 19 Jul 2020 16:36:34 -0500 Subject: [PATCH] Fix bug that prevented Mark All As Read button from enabling until a status change event occurred --- Multiplatform/Shared/SceneModel.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Multiplatform/Shared/SceneModel.swift b/Multiplatform/Shared/SceneModel.swift index a6b2fc57a..a1f434d01 100644 --- a/Multiplatform/Shared/SceneModel.swift +++ b/Multiplatform/Shared/SceneModel.swift @@ -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)