mirror of
https://github.com/siyuan-note/siyuan
synced 2026-04-21 13:37:52 +00:00
♻️ Skip subdoc dir scan when parent doc is hidden https://github.com/siyuan-note/siyuan/issues/17533 (#17554)
This commit is contained in:
parent
0ddcf82eb2
commit
c8a093fe1d
2 changed files with 13 additions and 15 deletions
|
|
@ -182,8 +182,7 @@ func setNodeAttrs(node *ast.Node, tree *parse.Tree, nameValues map[string]string
|
|||
|
||||
pushBlockAttrs(oldAttrs, node)
|
||||
|
||||
if ("true" == oldAttrs[DocHiddenAttr] && "true" != nameValues[DocHiddenAttr]) ||
|
||||
"true" != oldAttrs[DocHiddenAttr] && "true" == nameValues[DocHiddenAttr] {
|
||||
if ("true" == oldAttrs[DocHiddenAttr]) != ("true" == nameValues[DocHiddenAttr]) {
|
||||
ReloadFiletree()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -135,20 +135,19 @@ func refreshDocInfo0(tree *parse.Tree, size uint64) {
|
|||
}
|
||||
|
||||
subFileCount := 0
|
||||
subDir := filepath.Join(util.DataDir, tree.Box, strings.TrimSuffix(tree.Path, ".sy"))
|
||||
subFiles, err := os.ReadDir(subDir)
|
||||
if err == nil {
|
||||
for _, subFile := range subFiles {
|
||||
if "true" == tree.Root.IALAttr(DocHiddenAttr) {
|
||||
continue
|
||||
}
|
||||
if "true" != tree.Root.IALAttr(DocHiddenAttr) {
|
||||
subDir := filepath.Join(util.DataDir, tree.Box, strings.TrimSuffix(tree.Path, ".sy"))
|
||||
subFiles, err := os.ReadDir(subDir)
|
||||
if err == nil {
|
||||
for _, subFile := range subFiles {
|
||||
if !strings.HasSuffix(subFile.Name(), ".sy") {
|
||||
continue
|
||||
}
|
||||
|
||||
subDocIAL := filesys.DocIAL(filepath.Join(subDir, subFile.Name()))
|
||||
if "true" == subDocIAL[DocHiddenAttr] {
|
||||
continue
|
||||
}
|
||||
|
||||
if strings.HasSuffix(subFile.Name(), ".sy") {
|
||||
subDocIAL := filesys.DocIAL(filepath.Join(subDir, subFile.Name()))
|
||||
if "true" == subDocIAL[DocHiddenAttr] {
|
||||
continue
|
||||
}
|
||||
subFileCount++
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue