[Link new device] Automatically rotate the QR Code

This commit is contained in:
Benoit Marty 2026-05-19 09:00:11 +02:00 committed by Benoit Marty
parent 5af57906b5
commit c59b96de66
9 changed files with 152 additions and 12 deletions

View file

@ -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()))
}
}
}