fix: empty App ID no longer crashes the game environment editor (#1014)

This commit is contained in:
Resul Övür authored and GitHub committed 2026-10-20 18:31:27 -04:00
1 parent bdd2485e96
commit 87763976d8
1 file changed
+4 -4
@@ -143,15 +143,15 @@ internal fun GameEnvironmentEditor(byPad: Boolean, initialScope: String = "", on
}
}
otherId?.let { id ->
val valid = id.isNotEmpty() && GameEnvironment.validScope(id)
val open = { if (valid) { scope = id.toLong().toString(); otherId = null } }
Row(verticalAlignment = Alignment.Bottom, horizontalArrangement = Arrangement.spacedBy(10.dp)) {
AdbTextField(
id, { otherId = it.filter(Char::isDigit) }, stringResource(R.string.game_env_app_id), KeyboardType.Number, ImeAction.Done,
modifier = Modifier.weight(1f), compact = true,
onDone = { if (GameEnvironment.validScope(id)) { scope = id.toLong().toString(); otherId = null } },
onDone = open,
)
SecondaryButton(stringResource(R.string.game_env_open), enabled = id.isNotEmpty() && GameEnvironment.validScope(id)) {
scope = id.toLong().toString(); otherId = null
}
SecondaryButton(stringResource(R.string.game_env_open), enabled = valid, onClick = open)
}
}
if (error) Small(stringResource(R.string.game_env_error), error = true)