mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
QR login from device manager (#6818)
* Add link device button into the sessions overview screen * Run Swift format * Fix tests * Fix a crash in tests * Fix PR remark
This commit is contained in:
@@ -41,7 +41,7 @@ final class UserSessionsFlowCoordinator: Coordinator, Presentable {
|
||||
init(parameters: UserSessionsFlowCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
|
||||
self.navigationRouter = parameters.router
|
||||
navigationRouter = parameters.router
|
||||
errorPresenter = MXKErrorAlertPresentation()
|
||||
indicatorPresenter = UserIndicatorTypePresenter(presentingViewController: parameters.router.toPresentable())
|
||||
}
|
||||
@@ -75,6 +75,8 @@ final class UserSessionsFlowCoordinator: Coordinator, Presentable {
|
||||
self.openOtherSessions(sessionInfos: sessionInfos,
|
||||
filterBy: filter,
|
||||
title: VectorL10n.userOtherSessionSecurityRecommendationTitle)
|
||||
case .linkDevice:
|
||||
self.openQRLoginScreen()
|
||||
}
|
||||
}
|
||||
return coordinator
|
||||
@@ -105,6 +107,21 @@ final class UserSessionsFlowCoordinator: Coordinator, Presentable {
|
||||
}
|
||||
pushScreen(with: coordinator)
|
||||
}
|
||||
|
||||
/// Shows the QR login screen.
|
||||
private func openQRLoginScreen() {
|
||||
let service = QRLoginService(client: parameters.session.matrixRestClient,
|
||||
mode: .authenticated)
|
||||
let parameters = AuthenticationQRLoginStartCoordinatorParameters(navigationRouter: navigationRouter,
|
||||
qrLoginService: service)
|
||||
let coordinator = AuthenticationQRLoginStartCoordinator(parameters: parameters)
|
||||
coordinator.callback = { [weak self, weak coordinator] _ in
|
||||
guard let self = self, let coordinator = coordinator else { return }
|
||||
self.remove(childCoordinator: coordinator)
|
||||
}
|
||||
|
||||
pushScreen(with: coordinator)
|
||||
}
|
||||
|
||||
private func createUserSessionOverviewCoordinator(sessionInfo: UserSessionInfo) -> UserSessionOverviewCoordinator {
|
||||
let parameters = UserSessionOverviewCoordinatorParameters(session: parameters.session,
|
||||
@@ -135,7 +152,6 @@ final class UserSessionsFlowCoordinator: Coordinator, Presentable {
|
||||
return UserOtherSessionsCoordinator(parameters: parameters)
|
||||
}
|
||||
|
||||
|
||||
/// Shows a confirmation dialog to the user to sign out of a session.
|
||||
private func showLogoutConfirmation(for sessionInfo: UserSessionInfo) {
|
||||
// Use a UIAlertController as we don't have confirmationDialog in SwiftUI on iOS 14.
|
||||
|
||||
Reference in New Issue
Block a user