Fix show canary channel on stable build

This commit is contained in:
vvb2060 2021-02-23 22:55:24 +08:00 committed by John Wu
parent 35f3766ecf
commit 8b2ab778c9

View File

@ -144,9 +144,10 @@ object UpdateChannel : BaseSettingsItem.Selector() {
} }
override val title = R.string.settings_update_channel_title.asTransitive() override val title = R.string.settings_update_channel_title.asTransitive()
override val entries: Array<String> = resources.getStringArray(R.array.update_channel).apply { override val entries: Array<String> = resources.getStringArray(R.array.update_channel).let {
if (BuildConfig.VERSION_CODE % 100 == 0) if (BuildConfig.VERSION_CODE % 100 == 0)
toMutableList().apply { removeAt(Config.Value.CANARY_CHANNEL) }.toTypedArray() it.toMutableList().apply { removeAt(Config.Value.CANARY_CHANNEL) }.toTypedArray()
else it
} }
override val description override val description
get() = entries.getOrNull(value)?.asTransitive() ?: TransitiveText.String(entries[0]) get() = entries.getOrNull(value)?.asTransitive() ?: TransitiveText.String(entries[0])