From 961f4576afdaac453403e9a634bba2c6f0bdd947 Mon Sep 17 00:00:00 2001 From: Soichi Ikebe Date: Thu, 5 Dec 2024 01:07:04 +0900 Subject: [PATCH] Don't show GPT option if disabled --- app/src/main/java/com/aqua_ix/youbimiku/MainActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/aqua_ix/youbimiku/MainActivity.kt b/app/src/main/java/com/aqua_ix/youbimiku/MainActivity.kt index 7820566..1d85798 100644 --- a/app/src/main/java/com/aqua_ix/youbimiku/MainActivity.kt +++ b/app/src/main/java/com/aqua_ix/youbimiku/MainActivity.kt @@ -676,7 +676,9 @@ class MainActivity : AppCompatActivity(), View.OnClickListener, DialogListener { } private fun showAIModelDialog(cancelable: Boolean = true) { - val aiModels = AIModelConfig.entries.toTypedArray() + val aiModels = AIModelConfig.entries.filter { + it != AIModelConfig.OPEN_AI || remoteConfig.getBoolean(RemoteConfigKey.OPENAI_ENABLED) + }.toTypedArray() val aiModelNames = aiModels.map { getDisplayName(this, it) }.toTypedArray() val currentIndex = aiModels.indexOfFirst { it.name == getAIModel(this) }