mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Lock the Link New Device flow to portrait and improve Cancel/Try Again handling. (#5094)
* Lock the LinkNewDeviceScreen to portrait. * Add cancel buttons to the QR Code errors and handle cancel/startOver correctly. * Use the shared QRCodeErrorView in the LinkNewDeviceScreen. * Clarify the different QR Error/ErrorStates a bit more. * Update snapshots.
This commit is contained in:
@@ -16,10 +16,12 @@ enum LinkNewDeviceScreenCoordinatorAction {
|
||||
|
||||
struct LinkNewDeviceScreenCoordinatorParameters {
|
||||
let clientProxy: ClientProxyProtocol
|
||||
let orientationManager: OrientationManagerProtocol
|
||||
}
|
||||
|
||||
final class LinkNewDeviceScreenCoordinator: CoordinatorProtocol {
|
||||
private let viewModel: LinkNewDeviceScreenViewModelProtocol
|
||||
private let orientationManager: OrientationManagerProtocol
|
||||
|
||||
private var cancellables = Set<AnyCancellable>()
|
||||
|
||||
@@ -30,6 +32,7 @@ final class LinkNewDeviceScreenCoordinator: CoordinatorProtocol {
|
||||
|
||||
init(parameters: LinkNewDeviceScreenCoordinatorParameters) {
|
||||
viewModel = LinkNewDeviceScreenViewModel(clientProxy: parameters.clientProxy)
|
||||
orientationManager = parameters.orientationManager
|
||||
}
|
||||
|
||||
func start() {
|
||||
@@ -47,6 +50,13 @@ final class LinkNewDeviceScreenCoordinator: CoordinatorProtocol {
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
orientationManager.setOrientation(.portrait)
|
||||
orientationManager.lockOrientation(.portrait)
|
||||
}
|
||||
|
||||
func stop() {
|
||||
orientationManager.lockOrientation(.all)
|
||||
}
|
||||
|
||||
func toPresentable() -> AnyView {
|
||||
|
||||
Reference in New Issue
Block a user