mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-24 18:59:36 +00:00
Handle an API change where QR code logins now return a task. (#6354)
Quick workaround for now, proper task cancellation will follow.
This commit is contained in:
@@ -230,7 +230,7 @@ class AuthenticationService: AuthenticationServiceProtocol {
|
||||
do {
|
||||
let client = try await makeClient(serverNameOrBaseURL: scannedServerNameOrBaseURL)
|
||||
let qrCodeHandler = client.newLoginWithQrCodeHandler(oauthConfiguration: appSettings.oAuthConfiguration.rustValue)
|
||||
try await qrCodeHandler.scan(qrCodeData: qrData, progressListener: listener)
|
||||
try await qrCodeHandler.scan(qrCodeData: qrData, progressListener: listener).wait()
|
||||
|
||||
switch await userSession(for: client) {
|
||||
case .success(let userSession):
|
||||
|
||||
@@ -77,7 +77,7 @@ class LinkNewDeviceService: LinkNewDeviceServiceProtocol {
|
||||
defer { progressContinuation.finish() }
|
||||
do {
|
||||
// Note: The SDK doesn't provide us with a way to cancel the grant if the user hit the cancel button 🤷♂️
|
||||
try await grantLoginHandler.generate(progressListener: listener) // The success state is handled by the listener.
|
||||
try await grantLoginHandler.generate(progressListener: listener).wait() // The success state is handled by the listener.
|
||||
// We send the .done progress in case the listener didn't get a chance to pass it on from the SDK before being deallocated
|
||||
progressSubject.send(LinkMobileProgress.done)
|
||||
} catch let error as HumanQrGrantLoginError {
|
||||
@@ -131,7 +131,7 @@ class LinkNewDeviceService: LinkNewDeviceServiceProtocol {
|
||||
defer { progressContinuation.finish() }
|
||||
do {
|
||||
// Note: The SDK doesn't provide us with a way to cancel the grant if the user hit the cancel button 🤷♂️
|
||||
try await grantLoginHandler.scan(qrCodeData: qrCodeData, progressListener: listener) // The success state is handled by the listener.
|
||||
try await grantLoginHandler.scan(qrCodeData: qrCodeData, progressListener: listener).wait() // The success state is handled by the listener.
|
||||
// We send the .done progress in case the listener didn't get a chance to pass it on from the SDK before being deallocated
|
||||
progressSubject.send(LinkDesktopProgress.done)
|
||||
} catch let error as HumanQrGrantLoginError {
|
||||
|
||||
Reference in New Issue
Block a user