Commit 860a05ab authored by vvb2060's avatar vvb2060 Committed by John Wu

Simplify UpdateChannel

parent 8bb2f356
......@@ -144,12 +144,12 @@ object UpdateChannel : BaseSettingsItem.Selector() {
}
override val title = R.string.settings_update_channel_title.asTransitive()
override val entries: Array<String> = resources.getStringArray(R.array.update_channel).let {
if (BuildConfig.DEBUG) it.toMutableList().apply { add("Canary") }.toTypedArray() else it
override val entries: Array<String> = resources.getStringArray(R.array.update_channel).apply {
if (BuildConfig.VERSION_CODE % 100 == 0)
toMutableList().apply { removeAt(Config.Value.CANARY_CHANNEL) }.toTypedArray()
}
override val description
get() = entries.getOrNull(value)?.asTransitive()
?: TransitiveText.String(if (value == -1) entries[0] else "Canary")
get() = entries.getOrNull(value)?.asTransitive() ?: TransitiveText.String(entries[0])
}
object UpdateChannelUrl : BaseSettingsItem.Input() {
......
......@@ -73,6 +73,7 @@
<item>@string/settings_update_stable</item>
<item>@string/settings_update_beta</item>
<item>@string/settings_update_custom</item>
<item>Canary</item>
</string-array>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment