Automatically try again on partial failed QR scan
This commit is contained in:
parent
8cfe6b1363
commit
cf1c7515fb
|
@ -63,6 +63,7 @@ class QrCodeLoginInstructionsFragment : VectorBaseFragment<FragmentQrCodeLoginIn
|
|||
val scannedQrCode = QrCodeScannerActivity.getResultText(activityResult.data)
|
||||
val wasQrCode = QrCodeScannerActivity.getResultIsQrCode(activityResult.data)
|
||||
|
||||
Timber.d("Scanned QR code: $scannedQrCode, was QR code: $wasQrCode")
|
||||
if (wasQrCode && !scannedQrCode.isNullOrBlank()) {
|
||||
onQrCodeScanned(scannedQrCode)
|
||||
} else {
|
||||
|
@ -76,7 +77,11 @@ class QrCodeLoginInstructionsFragment : VectorBaseFragment<FragmentQrCodeLoginIn
|
|||
}
|
||||
|
||||
private fun onQrCodeScannerFailed() {
|
||||
Timber.d("QrCodeLoginInstructionsFragment.onQrCodeScannerFailed")
|
||||
// The user scanned something unexpected, so we try scanning again.
|
||||
// This seems to happen particularly with the large QRs needed for rendezvous
|
||||
// especially when the QR is partially off the screen
|
||||
Timber.d("QrCodeLoginInstructionsFragment.onQrCodeScannerFailed - showing scanner again")
|
||||
QrCodeScannerActivity.startForResult(requireActivity(), scanActivityResultLauncher)
|
||||
}
|
||||
|
||||
override fun invalidate() = withState(viewModel) { state ->
|
||||
|
|
Loading…
Reference in New Issue