feat: trigger timeline fetching after publish post
This commit is contained in:
parent
f2795c035a
commit
353e752083
|
@ -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
|
||||
|
|
|
@ -36,6 +36,7 @@ final class HomeTimelineViewModel: NSObject {
|
|||
|
||||
let timelineIsEmpty = CurrentValueSubject<Bool, Never>(false)
|
||||
let homeTimelineNeedRefresh = PassthroughSubject<Void, Never>()
|
||||
|
||||
// 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 {
|
||||
|
|
Loading…
Reference in New Issue