diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index 1e0d7aa6d..3558a4a4d 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -2197,6 +2197,8 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni [[[ReviewSessionAlertSnoozeController alloc] init] clearSnooze]; + [TimelinePollProvider.shared reset]; + #ifdef MX_CALL_STACK_ENDPOINT // Erase all created certificates and private keys by MXEndpointCallStack for (MXKAccount *account in MXKAccountManager.sharedManager.accounts) diff --git a/RiotSwiftUI/Modules/Room/TimelinePoll/Coordinator/TimelinePollProvider.swift b/RiotSwiftUI/Modules/Room/TimelinePoll/Coordinator/TimelinePollProvider.swift index 31fb63849..7d9adef58 100644 --- a/RiotSwiftUI/Modules/Room/TimelinePoll/Coordinator/TimelinePollProvider.swift +++ b/RiotSwiftUI/Modules/Room/TimelinePoll/Coordinator/TimelinePollProvider.swift @@ -16,13 +16,14 @@ import Foundation -class TimelinePollProvider { +@objcMembers +class TimelinePollProvider: NSObject { static let shared = TimelinePollProvider() var session: MXSession? var coordinatorsForEventIdentifiers = [String: TimelinePollCoordinator]() - private init() { } + private override init() { } /// Create or retrieve the poll timeline coordinator for this event and return /// a view to be displayed in the timeline @@ -49,4 +50,8 @@ class TimelinePollProvider { func timelinePollCoordinatorForEventIdentifier(_ eventIdentifier: String) -> TimelinePollCoordinator? { coordinatorsForEventIdentifiers[eventIdentifier] } + + func reset() { + coordinatorsForEventIdentifiers.removeAll() + } }