Merge pull request #91 from QuentinHsu/fix-model-name-not-trimmed

fix: model name not trimmed
This commit is contained in:
Calcium-Ion 2024-03-05 23:08:19 +08:00 committed by GitHub
commit d5c5c30312
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -241,7 +241,7 @@ const EditChannel = (props) => {
const addCustomModel = () => {
if (customModel.trim() === '') return;
if (inputs.models.includes(customModel)) return;
if (inputs.models.includes(customModel)) return showError("该模型已存在!");
let localModels = [...inputs.models];
localModels.push(customModel);
let localModelOptions = [];
@ -454,7 +454,7 @@ const EditChannel = (props) => {
placeholder='输入自定义模型名称'
value={customModel}
onChange={(value) => {
setCustomModel(value);
setCustomModel(value.trim());
}}
/>
</div>