fix: disable periodic maintenance on logout (MESSENGER-5896)

This commit is contained in:
Frank Rotermund
2024-07-29 14:52:02 +02:00
parent 2180870764
commit d5ca308e49
6 changed files with 26 additions and 1 deletions

View File

@@ -330,6 +330,8 @@ extension AppCoordinator: LegacyAppDelegateDelegate {
func legacyAppDelegate(_ legacyAppDelegate: LegacyAppDelegate!, didRemove account: MXKAccount!) {
self.userSessionsService.removeUserSession(relatedToAccount: account)
// bwi #5896 need logout info in allchatcoordnator
self.splitViewCoordinator?.onLogout()
}
func legacyAppDelegate(_ legacyAppDelegate: LegacyAppDelegate!, didNavigateToSpaceWithId spaceId: String!) {

View File

@@ -224,6 +224,10 @@ class AllChatsCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
appSateIndicator = nil
}
func onLogout() {
onBWILogout()
}
// MARK: - SplitViewMasterPresentable
var selectedNavigationRouter: NavigationRouterType? {
@@ -622,7 +626,7 @@ class AllChatsCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
MXLog.warning("[AllChatsCoordinator] Unable to sign out due to missing current session.")
return
}
let flowPresenter = SignOutFlowPresenter(session: session, presentingViewController: toPresentable())
flowPresenter.delegate = self
@@ -778,6 +782,11 @@ class AllChatsCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
self.bwiCheckForMatomoPromt()
}, failure: nil)
}
private func onBWILogout() {
// bwi #5896 disable periodic maintenance fetching when user not logged in == No selected server to fetch from
enableMaintenanceTimer(false)
}
}
extension AllChatsCoordinator: SignOutFlowPresenterDelegate {

View File

@@ -171,6 +171,10 @@ final class SplitViewCoordinator: NSObject, SplitViewCoordinatorType {
func showAppStateIndicator(with text: String, icon: UIImage?) {
masterCoordinator?.showAppStateIndicator(with: text, icon: icon)
}
func onLogout() {
masterCoordinator?.onLogout()
}
// MARK: - Private methods

View File

@@ -48,4 +48,7 @@ protocol SplitViewCoordinatorType: Coordinator, Presentable {
/// Hide the message related to the application state currently displayed.
func hideAppStateIndicator()
/// remove maintenace timer
func onLogout()
}

View File

@@ -49,4 +49,7 @@ protocol SplitViewMasterCoordinatorProtocol: Coordinator, SplitViewMasterPresent
/// Hide the message related to the application state currently displayed.
func hideAppStateIndicator()
/// clear maintenance timer
func onLogout()
}

View File

@@ -244,6 +244,10 @@ final class TabBarCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
appSateIndicator = nil
}
func onLogout() {
}
// MARK: - SplitViewMasterPresentable
var selectedNavigationRouter: NavigationRouterType? {