diff --git a/Multiplatform/Shared/Timeline/TimelineModel.swift b/Multiplatform/Shared/Timeline/TimelineModel.swift index 4f410e14e..a28aabd55 100644 --- a/Multiplatform/Shared/Timeline/TimelineModel.swift +++ b/Multiplatform/Shared/Timeline/TimelineModel.swift @@ -181,6 +181,7 @@ private extension TimelineModel { readFilterAndFeedsPublisher = toggledReadFilterPublisher .merge(with: feedsReadFilterPublisher) + .share(replay: 1) .eraseToAnyPublisher() } diff --git a/Multiplatform/Shared/Timeline/TimelineToolbarModifier.swift b/Multiplatform/Shared/Timeline/TimelineToolbarModifier.swift index a4ede9729..1d8445220 100644 --- a/Multiplatform/Shared/Timeline/TimelineToolbarModifier.swift +++ b/Multiplatform/Shared/Timeline/TimelineToolbarModifier.swift @@ -30,6 +30,9 @@ struct TimelineToolbarModifier: ViewModifier { AppAssets.filterInactiveImage.font(.title3) } } + .onReceive(timelineModel.readFilterAndFeedsPublisher!) { (_, filtered) in + isReadFiltered = filtered + } .hidden(isReadFiltered == nil) .help(isReadFiltered ?? false ? "Show Read Articles" : "Filter Read Articles") } @@ -49,9 +52,6 @@ struct TimelineToolbarModifier: ViewModifier { } #endif } - .onReceive(timelineModel.readFilterAndFeedsPublisher!) { (_, filtered) in - isReadFiltered = filtered - } } }