ソースを参照

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

fix: model name not trimmed
Calcium-Ion 2 年 前
コミット
d5c5c30312
1 ファイル変更2 行追加2 行削除
  1. 2 2
      web/src/pages/Channel/EditChannel.js

+ 2 - 2
web/src/pages/Channel/EditChannel.js

@@ -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>