mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 04:36:04 +00:00
fix: polish Android QR scanner onboarding (#45021)
This commit is contained in:
@@ -562,8 +562,8 @@ fun OnboardingFlow(viewModel: MainViewModel, modifier: Modifier = Modifier) {
|
||||
.addOnCanceledListener {
|
||||
// User dismissed the scanner; preserve current form state.
|
||||
}
|
||||
.addOnFailureListener { error ->
|
||||
gatewayError = resolveQrScannerError(error)
|
||||
.addOnFailureListener {
|
||||
gatewayError = qrScannerErrorMessage()
|
||||
}
|
||||
},
|
||||
onAdvancedOpenChange = { gatewayAdvancedOpen = it },
|
||||
@@ -1790,10 +1790,8 @@ private fun isPermissionGranted(context: Context, permission: String): Boolean {
|
||||
return ContextCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED
|
||||
}
|
||||
|
||||
private fun resolveQrScannerError(error: Exception): String {
|
||||
val detail = error.message?.trim().orEmpty()
|
||||
val prefix = "Google Code Scanner could not start. Update Google Play services or use the setup code manually."
|
||||
return if (detail.isEmpty()) prefix else "$prefix ($detail)"
|
||||
private fun qrScannerErrorMessage(): String {
|
||||
return "Google Code Scanner could not start. Update Google Play services or use the setup code manually."
|
||||
}
|
||||
|
||||
private fun isNotificationListenerEnabled(context: Context): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user