fix(stores): a game page no longer leaves the pad's focus on a dead card and crashes the next press

This commit is contained in:
xXJsonDeruloXx committed 2026-10-09 13:16:10 -04:00
1 parent 67cf1cdd9c
commit 90af0b9c0c
1 file changed
+9 -1
@@ -920,7 +920,15 @@ class MainActivity : ComponentActivity() {
}
return true
}
return super.dispatchKeyEvent(event)
// Compose throws when its focus tree has lost the focused node; one key is dropped
// instead of the app.
return try {
super.dispatchKeyEvent(event)
} catch (e: IllegalStateException) {
if (e.message?.contains("active focus target") != true) throw e
android.util.Log.w("MainActivity", "key ${event.keyCode} dropped: ${e.message}")
true
}
}
override fun onResume() {