🐛 When maxListCount limit is not reached, the wrong pop-up box prompts a maxListCount error (#8846)
box.Ls(path) will count the same document repeatedly (x/x.sy). Before checking maxListCount limit, assign len(ret) to the totals variable so that it only represents the number of .sy documents
This commit is contained in:
parent
53db7e22d4
commit
0c621de5d9
1 changed files with 2 additions and 0 deletions
|
@ -387,6 +387,7 @@ func ListDocTree(boxID, path string, sortMode int, flashcard bool, maxListCount
|
|||
return fileTreeFiles[i].Sort < fileTreeFiles[j].Sort
|
||||
})
|
||||
ret = append(ret, fileTreeFiles...)
|
||||
totals = len(ret)
|
||||
if maxListCount < len(ret) {
|
||||
ret = ret[:maxListCount]
|
||||
}
|
||||
|
@ -414,6 +415,7 @@ func ListDocTree(boxID, path string, sortMode int, flashcard bool, maxListCount
|
|||
ret = append(ret, docs...)
|
||||
}
|
||||
|
||||
totals = len(ret)
|
||||
if maxListCount < len(ret) {
|
||||
ret = ret[:maxListCount]
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue