Handle live polls

This commit is contained in:
Alfonso Grillo
2023-01-25 17:52:39 +01:00
parent cddf935fa8
commit 2e3aa18f6c
4 changed files with 67 additions and 5 deletions
@@ -97,6 +97,14 @@ private extension PollHistoryViewModel {
.fetchedUpTo
.weakAssign(to: \.state.syncedUpTo, on: self)
.store(in: &subcriptions)
pollService
.livePolls
.sink { [weak self] livePoll in
self?.add(polls: [livePoll])
self?.updateViewState()
}
.store(in: &subcriptions)
}
func update(poll: TimelinePollDetails) {