diff --git a/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift b/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift index 6aed1f574..529f2d81c 100644 --- a/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift +++ b/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift @@ -92,15 +92,13 @@ extension HomeTimelineViewController { viewModel.homeTimelineNavigationBarTitleViewModel.state .removeDuplicates() - .debounce(for: 0.3, scheduler: RunLoop.main) - .receive(on: RunLoop.main) + .receive(on: DispatchQueue.main) .sink { [weak self] state in guard let self = self else { return } self.titleView.configure(state: state) } .store(in: &disposeBag) - #if DEBUG // long press to trigger debug menu settingBarButtonItem.menu = debugMenu diff --git a/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel.swift b/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel.swift index 717519464..fdbbfba9d 100644 --- a/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel.swift +++ b/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel.swift @@ -36,6 +36,7 @@ final class HomeTimelineViewModel: NSObject { let timelineIsEmpty = CurrentValueSubject(false) let homeTimelineNeedRefresh = PassthroughSubject() + // output // top loader private(set) lazy var loadLatestStateMachine: GKStateMachine = { @@ -130,6 +131,12 @@ final class HomeTimelineViewModel: NSObject { } .store(in: &disposeBag) + homeTimelineNavigationBarTitleViewModel.isPublished + .sink { [weak self] isPublished in + guard let self = self else { return } + self.homeTimelineNeedRefresh.send() + } + .store(in: &disposeBag) } deinit {