瀏覽代碼

fix: tools edit modal schema edit issue (#6396)

Carson 10 月之前
父節點
當前提交
929c22a4e8
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      web/app/components/tools/edit-custom-collection-modal/index.tsx

+ 2 - 1
web/app/components/tools/edit-custom-collection-modal/index.tsx

@@ -87,9 +87,9 @@ const EditCustomCollectionModal: FC<Props> = ({
       return
     }
     (async () => {
-      const customCollection = getCustomCollection()
       try {
         const { parameters_schema, schema_type } = await parseParamsSchema(debouncedSchema)
+        const customCollection = getCustomCollection()
         const newCollection = produce(customCollection, (draft) => {
           draft.schema_type = schema_type
         })
@@ -97,6 +97,7 @@ const EditCustomCollectionModal: FC<Props> = ({
         setParamsSchemas(parameters_schema)
       }
       catch (e) {
+        const customCollection = getCustomCollection()
         const newCollection = produce(customCollection, (draft) => {
           draft.schema_type = ''
         })