This is an automated email from the ASF dual-hosted git repository.

likeguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new ce8a382f [BUG] Document page will occur error when no doc node (#314)
ce8a382f is described below

commit ce8a382f591cfdec7e38d5d17880689413774d79
Author: gongzhongqiang <[email protected]>
AuthorDate: Mon Aug 14 22:57:52 2023 +0800

    [BUG] Document page will occur error when no doc node (#314)
    
    Co-authored-by: gongzhongqiang <[email protected]>
---
 src/routes/Document/components/SearchApi.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/routes/Document/components/SearchApi.js 
b/src/routes/Document/components/SearchApi.js
index 3d91ab8d..bcfe2da7 100644
--- a/src/routes/Document/components/SearchApi.js
+++ b/src/routes/Document/components/SearchApi.js
@@ -58,11 +58,11 @@ const SearchApi = React.forwardRef((props, ref) => {
       }
       const { dataList: apiDataList } = apiDataRecords;
       data[0].apiDataList = apiDataList;
+      setTreeData(arr);
+      // 默认选中第一个
+      setSelectedKeys(["0"]);
+      onSelect(["0"], { node: { props: arr[0] } })
     }
-    setTreeData(arr);
-    // 默认选中第一个
-    setSelectedKeys(["0"]);
-    onSelect(["0"], { node: { props: arr[0] } })
   };
 
   const onExpand = async (keys, { expanded, node }) => {

Reply via email to