Files
element-x-ios/ElementX/Sources/Screens/LinkNewDeviceScreen/LinkNewDeviceScreenModels.swift
T
Doug 123661537a Make LinkNewDeviceScreen fall back to the App Lock PIN code when there's no passcode. (#5794)
* Fall back to the AppLock PIN code when there's no passcode.

* Add extra tests on the LinkNewDeviceFlowCoordinator.

* Misc tweaks for clarification.

* Regenerate snapshots.
2026-07-01 10:13:18 +01:00

41 lines
1.0 KiB
Swift

//
// Copyright 2025 Element Creations Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
// Please see LICENSE files in the repository root for full details.
//
import Foundation
enum LinkNewDeviceScreenViewModelAction {
case linkMobileDevice(LinkNewDeviceService.LinkMobileProgressPublisher)
case linkDesktopComputer
case verifyWithAppLockPIN(CheckedContinuation<Bool, Never>)
case dismiss
}
struct LinkNewDeviceScreenViewState: BindableState {
nonisolated enum Mode: Equatable {
enum ReadyState: Equatable {
case idle
case verifyingDeviceOwner
case generatingCode
}
case loading
case readyToLink(ReadyState)
case error(QRCodeLoginState.ErrorState)
}
var mode: Mode = .loading
let showLinkDesktopComputerButton: Bool
}
enum LinkNewDeviceScreenViewAction {
case linkMobileDevice
case linkDesktopComputer
case errorAction(QRCodeErrorView.Action)
case dismiss
}