fix: only show docs with depth < 3 in tree, hide nested leaf docs
This commit is contained in:
@@ -71,7 +71,9 @@ export const ApiDocViewer = ({ onDocsPathChange, showAddModal, onCloseAddModal }
|
|||||||
|
|
||||||
setExternalDocs(docs)
|
setExternalDocs(docs)
|
||||||
|
|
||||||
const fileList = docs.map(d => d.relativePath)
|
const fileList = docs
|
||||||
|
.filter(doc => doc.relativePath.split('/').length < 3)
|
||||||
|
.map(d => d.relativePath)
|
||||||
const tree = buildFileTree(fileList, '/')
|
const tree = buildFileTree(fileList, '/')
|
||||||
setFileTree(tree)
|
setFileTree(tree)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user