Cleanup unused code

This commit is contained in:
Alfonso Grillo
2023-01-26 10:14:26 +01:00
parent f280692d49
commit 694112e6de
3 changed files with 7 additions and 20 deletions
@@ -35,7 +35,6 @@ final class PollHistoryService: PollHistoryServiceProtocol {
// polls updates
private let updatesSubject: PassthroughSubject<TimelinePollDetails, Never> = .init()
private let pollErrorsSubject: PassthroughSubject<Error, Never> = .init()
// timestamps
private var targetTimestamp: Date = .init()
@@ -45,10 +44,6 @@ final class PollHistoryService: PollHistoryServiceProtocol {
updatesSubject.eraseToAnyPublisher()
}
var pollErrors: AnyPublisher<Error, Never> {
pollErrorsSubject.eraseToAnyPublisher()
}
init(room: MXRoom, chunkSizeInDays: UInt) {
self.room = room
self.chunkSizeInDays = chunkSizeInDays
@@ -211,8 +206,10 @@ private extension MXEvent {
extension PollHistoryService: PollAggregatorDelegate {
func pollAggregatorDidStartLoading(_ aggregator: PollAggregator) { }
func pollAggregator(_ aggregator: PollAggregator, didFailWithError: Error) { }
func pollAggregatorDidEndLoading(_ aggregator: PollAggregator) {
guard let context = pollAggregationContexts[aggregator.poll.id], !context.published else {
guard let context = pollAggregationContexts[aggregator.poll.id], context.published == false else {
return
}
@@ -227,11 +224,10 @@ extension PollHistoryService: PollAggregatorDelegate {
}
}
func pollAggregator(_ aggregator: PollAggregator, didFailWithError: Error) {
pollErrorsSubject.send(didFailWithError)
}
func pollAggregatorDidUpdateData(_ aggregator: PollAggregator) {
guard let context = pollAggregationContexts[aggregator.poll.id], context.published else {
return
}
updatesSubject.send(.init(poll: aggregator.poll, represent: .started))
}
}