Fix Settings crash when update channel is default (-1)

Config.Value.DEFAULT_CHANNEL is -1, which is out of bounds for the
SuperDropdown items list. Coerce to valid range on initialization.

Made-with: Cursor
This commit is contained in:
LoveSy
2026-03-16 02:48:20 -07:00
committed by topjohnwu
parent 397a906905
commit 20d6d70ff6
@@ -134,7 +134,9 @@ private fun AppSettingsSection(viewModel: SettingsViewModel) {
val updateChannelEntries = remember {
resources.getStringArray(CoreR.array.update_channel).toList()
}
var updateChannel by remember { mutableIntStateOf(Config.updateChannel) }
var updateChannel by remember {
mutableIntStateOf(Config.updateChannel.coerceIn(0, updateChannelEntries.size - 1))
}
var showUrlDialog by remember { mutableStateOf(false) }
SuperDropdown(