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
|
viewModel.homeTimelineNavigationBarTitleViewModel.state
|
||||||
.removeDuplicates()
|
.removeDuplicates()
|
||||||
.debounce(for: 0.3, scheduler: RunLoop.main)
|
.receive(on: DispatchQueue.main)
|
||||||
.receive(on: RunLoop.main)
|
|
||||||
.sink { [weak self] state in
|
.sink { [weak self] state in
|
||||||
guard let self = self else { return }
|
guard let self = self else { return }
|
||||||
self.titleView.configure(state: state)
|
self.titleView.configure(state: state)
|
||||||
}
|
}
|
||||||
.store(in: &disposeBag)
|
.store(in: &disposeBag)
|
||||||
|
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
// long press to trigger debug menu
|
// long press to trigger debug menu
|
||||||
settingBarButtonItem.menu = debugMenu
|
settingBarButtonItem.menu = debugMenu
|
||||||
|
|
|
@ -36,6 +36,7 @@ final class HomeTimelineViewModel: NSObject {
|
||||||
|
|
||||||
let timelineIsEmpty = CurrentValueSubject<Bool, Never>(false)
|
let timelineIsEmpty = CurrentValueSubject<Bool, Never>(false)
|
||||||
let homeTimelineNeedRefresh = PassthroughSubject<Void, Never>()
|
let homeTimelineNeedRefresh = PassthroughSubject<Void, Never>()
|
||||||
|
|
||||||
// output
|
// output
|
||||||
// top loader
|
// top loader
|
||||||
private(set) lazy var loadLatestStateMachine: GKStateMachine = {
|
private(set) lazy var loadLatestStateMachine: GKStateMachine = {
|
||||||
|
@ -130,6 +131,12 @@ final class HomeTimelineViewModel: NSObject {
|
||||||
}
|
}
|
||||||
.store(in: &disposeBag)
|
.store(in: &disposeBag)
|
||||||
|
|
||||||
|
homeTimelineNavigationBarTitleViewModel.isPublished
|
||||||
|
.sink { [weak self] isPublished in
|
||||||
|
guard let self = self else { return }
|
||||||
|
self.homeTimelineNeedRefresh.send()
|
||||||
|
}
|
||||||
|
.store(in: &disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
|
|
Loading…
Reference in New Issue