From 0c621de5d9a1c762a919911e3add7cfbb840d768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candy=E3=83=A1=E5=A5=B6=E7=B3=96?= <359031282@qq.com> Date: Sat, 29 Jul 2023 09:43:21 +0800 Subject: [PATCH] :bug: 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 --- kernel/model/file.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/model/file.go b/kernel/model/file.go index 8542f9190..be56fc848 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -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] }