mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
123661537a
* Fall back to the AppLock PIN code when there's no passcode. * Add extra tests on the LinkNewDeviceFlowCoordinator. * Misc tweaks for clarification. * Regenerate snapshots.
41 lines
1.0 KiB
Swift
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
|
|
}
|