From 8b2ab778c9bbcbf0da34cf94dd78e45232be2284 Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Tue, 23 Feb 2021 22:55:24 +0800 Subject: [PATCH] Fix show canary channel on stable build --- .../java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt index 901b5f3e0..fe176409b 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt @@ -144,9 +144,10 @@ object UpdateChannel : BaseSettingsItem.Selector() { } override val title = R.string.settings_update_channel_title.asTransitive() - override val entries: Array = resources.getStringArray(R.array.update_channel).apply { + override val entries: Array = resources.getStringArray(R.array.update_channel).let { 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 get() = entries.getOrNull(value)?.asTransitive() ?: TransitiveText.String(entries[0])