mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
[Link new device] Automatically rotate the QR Code
This commit is contained in:
committed by
Benoit Marty
parent
5af57906b5
commit
c59b96de66
+1
@@ -18,6 +18,7 @@ sealed interface LinkMobileStep {
|
||||
data object Uninitialized : LinkMobileStep
|
||||
data object Starting : LinkMobileStep
|
||||
data class QrReady(val data: String) : LinkMobileStep
|
||||
data object QrRotating : LinkMobileStep
|
||||
data class WaitingForAuth(val verificationUri: String) : LinkMobileStep
|
||||
data class QrScanned(val checkCodeSender: CheckCodeSender) : LinkMobileStep
|
||||
data class Error(val errorType: ErrorType) : LinkMobileStep
|
||||
|
||||
+8
-1
@@ -53,7 +53,14 @@ class RustLinkMobileHandler(
|
||||
_linkMobileStep.emit(LinkMobileStep.Done)
|
||||
} catch (e: HumanQrGrantLoginException) {
|
||||
Timber.tag(tag.value).w(e, "Error during QR login grant")
|
||||
_linkMobileStep.emit(LinkMobileStep.Error(e.map()))
|
||||
// Catch timeout here?
|
||||
if (_linkMobileStep.value is LinkMobileStep.QrReady
|
||||
&& e is HumanQrGrantLoginException.NotFound) {
|
||||
Timber.tag(tag.value).d("Emit QrRotating due to HumanQrGrantLoginException.NotFound")
|
||||
_linkMobileStep.emit(LinkMobileStep.QrRotating)
|
||||
} else {
|
||||
_linkMobileStep.emit(LinkMobileStep.Error(e.map()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user