mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user