We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents def77be + 77acf1d commit 0262ef7Copy full SHA for 0262ef7
1 file changed
app/src/main/java/com/aicode/feature/settings/presentation/component/ProviderEditorScreen.kt
@@ -147,7 +147,17 @@ fun ProviderEditorScreen(
147
useResponseApi = useResponseApi
148
)
149
150
+ // 新建场景下判断用户是否填写了实质内容:名称、API Key、Base URL 任一非空白,或已添加模型。
151
+ // 全空白时退出不应落库,否则会存入一条名为“新提供商”的空记录。
152
+ fun hasSubstantiveInput(): Boolean =
153
+ initialProvider != null ||
154
+ name.isNotBlank() ||
155
+ apiKey.isNotBlank() ||
156
+ baseUrl.isNotBlank() ||
157
+ models.isNotEmpty()
158
+
159
fun saveCurrent() {
160
+ if (!hasSubstantiveInput()) return
161
onSave(currentConfig())
162
}
163
0 commit comments