Skip to content

Commit

Permalink
/issues/5114 - Fixed poll timeline coordinator caching issues when us…
Browse files Browse the repository at this point in the history
…ing threads.
  • Loading branch information
stefanceriu committed Dec 6, 2021
1 parent 1c919db commit 46ca843
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
8 changes: 0 additions & 8 deletions Riot/Modules/Room/RoomCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ final class RoomCoordinator: NSObject, RoomCoordinatorProtocol {
self.activityIndicatorPresenter.removeCurrentActivityIndicator(animated: true)

if let roomDataSource = roomDataSource {
if #available(iOS 14, *) {
PollTimelineProvider.shared.room = roomDataSource.room
}

self.roomViewController.displayRoom(roomDataSource)
}

Expand All @@ -185,10 +181,6 @@ final class RoomCoordinator: NSObject, RoomCoordinatorProtocol {
guard let roomDataSource = dataSource as? RoomDataSource else {
return
}

if #available(iOS 14, *) {
PollTimelineProvider.shared.room = roomDataSource.room
}

roomDataSource.markTimelineInitialEvent = true
self.roomViewController.displayRoom(roomDataSource)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ class PollTimelineProvider {
static let shared = PollTimelineProvider()

var session: MXSession?
var room: MXRoom? {
didSet {
coordinatorsForEventIdentifiers.removeAll()
}
}

var coordinatorsForEventIdentifiers = [String: PollTimelineCoordinator]()

private init() {
Expand All @@ -36,7 +30,7 @@ class PollTimelineProvider {
/// Create or retrieve the poll timeline coordinator for this event and return
/// a view to be displayed in the timeline
func buildPollTimelineViewForEvent(_ event: MXEvent) -> UIView? {
guard let session = session, let room = room else {
guard let session = session, let room = session.room(withRoomId: event.roomId) else {
return nil
}

Expand Down

0 comments on commit 46ca843

Please sign in to comment.