mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-24 10:32:46 +02:00
Fix review comments
Also fix a crash on iPad.
This commit is contained in:
@@ -19,7 +19,7 @@ import Foundation
|
||||
|
||||
struct UserSessionsFlowCoordinatorParameters {
|
||||
let session: MXSession
|
||||
let router: NavigationRouterType?
|
||||
let router: NavigationRouterType
|
||||
}
|
||||
|
||||
final class UserSessionsFlowCoordinator: Coordinator, Presentable {
|
||||
@@ -41,11 +41,9 @@ final class UserSessionsFlowCoordinator: Coordinator, Presentable {
|
||||
init(parameters: UserSessionsFlowCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
|
||||
let navigationRouter = parameters.router ?? NavigationRouter(navigationController: RiotNavigationController())
|
||||
self.navigationRouter = navigationRouter
|
||||
|
||||
self.navigationRouter = parameters.router
|
||||
errorPresenter = MXKErrorAlertPresentation()
|
||||
indicatorPresenter = UserIndicatorTypePresenter(presentingViewController: navigationRouter.toPresentable())
|
||||
indicatorPresenter = UserIndicatorTypePresenter(presentingViewController: parameters.router.toPresentable())
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
@@ -146,6 +144,7 @@ final class UserSessionsFlowCoordinator: Coordinator, Presentable {
|
||||
self?.showLogoutAuthentication(for: sessionInfo)
|
||||
})
|
||||
alert.addAction(UIAlertAction(title: VectorL10n.cancel, style: .cancel))
|
||||
alert.popoverPresentationController?.sourceView = toPresentable().view
|
||||
|
||||
navigationRouter.present(alert, animated: true)
|
||||
}
|
||||
@@ -154,9 +153,7 @@ final class UserSessionsFlowCoordinator: Coordinator, Presentable {
|
||||
private func showLogoutAuthentication(for sessionInfo: UserSessionInfo) {
|
||||
startLoading()
|
||||
|
||||
let path = String(format: "%@/devices/%@", kMXAPIPrefixPathR0, MXTools.encodeURIComponent(sessionInfo.id))
|
||||
let deleteDeviceRequest = AuthenticatedEndpointRequest(path: path, httpMethod: "DELETE")
|
||||
|
||||
let deleteDeviceRequest = AuthenticatedEndpointRequest.deleteDevice(sessionInfo.id)
|
||||
let coordinatorParameters = ReauthenticationCoordinatorParameters(session: parameters.session,
|
||||
presenter: navigationRouter.toPresentable(),
|
||||
title: VectorL10n.deviceDetailsDeletePromptTitle,
|
||||
|
||||
+2
-6
@@ -42,12 +42,8 @@ final class UserSessionsFlowCoordinatorBridgePresenter: NSObject {
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func startUserSessionsFlow(mxSession: MXSession, navigationController: UINavigationController?) {
|
||||
var navigationRouter: NavigationRouterType?
|
||||
|
||||
if let navigationController = navigationController {
|
||||
navigationRouter = NavigationRouterStore.shared.navigationRouter(for: navigationController)
|
||||
}
|
||||
private func startUserSessionsFlow(mxSession: MXSession, navigationController: UINavigationController) {
|
||||
let navigationRouter = NavigationRouterStore.shared.navigationRouter(for: navigationController)
|
||||
|
||||
let parameters = UserSessionsFlowCoordinatorParameters(session: mxSession, router: navigationRouter)
|
||||
let coordinator = UserSessionsFlowCoordinator(parameters: parameters)
|
||||
|
||||
Reference in New Issue
Block a user