mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Link new device with QR code tweaks. (#5563)
* Hook up Rust's InvalidCheckCode failure to the right state when linking a new device. * Automatically regenerate a new QR code instead of ending the flow when it expires.
This commit is contained in:
@@ -111,6 +111,7 @@ enum QRCodeLoginError: Error, Equatable {
|
||||
case providerNotAllowed(scannedProvider: String, allowedProviders: [String])
|
||||
case cancelled
|
||||
case connectionInsecure
|
||||
case invalidCheckCode
|
||||
case declined
|
||||
case linkingNotSupported
|
||||
case expired
|
||||
|
||||
@@ -195,8 +195,10 @@ extension LinkNewDeviceService.LinkDesktopProgress: CustomStringConvertible {
|
||||
private extension QRCodeLoginError {
|
||||
init(rustError: HumanQrGrantLoginError) {
|
||||
self = switch rustError {
|
||||
case .InvalidCheckCode, .ConnectionInsecure:
|
||||
case .ConnectionInsecure:
|
||||
.connectionInsecure
|
||||
case .InvalidCheckCode:
|
||||
.invalidCheckCode
|
||||
case .UnsupportedProtocol:
|
||||
.linkingNotSupported
|
||||
case .Expired, .NotFound, .DeviceNotFound:
|
||||
@@ -227,13 +229,6 @@ class CheckCodeSenderProxy: Equatable {
|
||||
func send(code: UInt8) async throws {
|
||||
try await underlyingSender.send(code: code)
|
||||
}
|
||||
|
||||
/// Bypassed for now whilst we wait for an SDK update (however its worth noting that
|
||||
/// things should still fail if the wrong code is provided, just not necessarily with
|
||||
/// the right error being shown). https://github.com/matrix-org/matrix-rust-sdk/pull/5957
|
||||
func validate(checkCode: UInt8) -> Bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
extension UIImage {
|
||||
|
||||
Reference in New Issue
Block a user