mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-23 02:26:36 +08:00
Merge pull request #91 from QuentinHsu/fix-model-name-not-trimmed
fix: model name not trimmed
This commit is contained in:
commit
d5c5c30312
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user