Skip to content

Commit

Permalink
Merge pull request #7072 from vector-im/aleksandrs/7070_poll_no_usable
Browse files Browse the repository at this point in the history
Poll not usable after logging out and back in
  • Loading branch information
Aleksandrs Proskurins authored Nov 14, 2022
2 parents 6ed6bc0 + d769f01 commit 2630bbf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Riot/Modules/Application/LegacyAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2197,6 +2197,8 @@ - (void)logoutSendingRequestServer:(BOOL)sendLogoutServerRequest

[[[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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@

import Foundation

class TimelinePollProvider {
@objcMembers
class TimelinePollProvider: NSObject {
static let shared = TimelinePollProvider()

var session: MXSession?
var coordinatorsForEventIdentifiers = [String: TimelinePollCoordinator]()

private init() { }

/// Create or retrieve the poll timeline coordinator for this event and return
/// a view to be displayed in the timeline
func buildTimelinePollVCForEvent(_ event: MXEvent) -> UIViewController? {
Expand All @@ -49,4 +48,8 @@ class TimelinePollProvider {
func timelinePollCoordinatorForEventIdentifier(_ eventIdentifier: String) -> TimelinePollCoordinator? {
coordinatorsForEventIdentifiers[eventIdentifier]
}

func reset() {
coordinatorsForEventIdentifiers.removeAll()
}
}
1 change: 1 addition & 0 deletions changelog.d/7070.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Poll not usable after logging out and back in.

0 comments on commit 2630bbf

Please sign in to comment.