mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
Fix default channel shown in UI
This commit is contained in:
@@ -173,7 +173,7 @@ private fun AppSettingsSection() {
|
||||
resources.getStringArray(CoreR.array.update_channel).toList()
|
||||
}
|
||||
var updateChannel by remember {
|
||||
mutableIntStateOf(Config.updateChannel.coerceIn(0, updateChannelEntries.size - 1))
|
||||
mutableIntStateOf(Config.updateChannelIndex)
|
||||
}
|
||||
var showUrlDialog by remember { mutableStateOf(false) }
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ object DownloadPath : BaseSettingsItem.Input() {
|
||||
|
||||
object UpdateChannel : BaseSettingsItem.Selector() {
|
||||
override var value
|
||||
get() = Config.updateChannel
|
||||
get() = Config.updateChannelIndex
|
||||
set(value) {
|
||||
Config.updateChannel = value
|
||||
Info.resetUpdate()
|
||||
|
||||
@@ -116,6 +116,11 @@ object Config : PreferenceConfig, DBConfig {
|
||||
private var localePrefs by preference(Key.LOCALE, "")
|
||||
var doh by preference(Key.DOH, false)
|
||||
var updateChannel by preference(Key.RELEASE_CHANNEL, Value.DEFAULT_CHANNEL)
|
||||
val updateChannelIndex get() = when (updateChannel) {
|
||||
Value.DEFAULT_CHANNEL ->
|
||||
if (BuildConfig.DEBUG) Value.DEBUG_CHANNEL else Value.STABLE_CHANNEL
|
||||
else -> updateChannel
|
||||
}
|
||||
var customChannelUrl by preference(Key.CUSTOM_CHANNEL, "")
|
||||
var downloadDir by preference(Key.DOWNLOAD_DIR, "")
|
||||
var randName by preference(Key.RAND_NAME, true)
|
||||
|
||||
Reference in New Issue
Block a user