diff --git a/kernel/model/file.go b/kernel/model/file.go index 1be997f73..6b365caaf 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -1124,14 +1124,21 @@ func MoveDocs(fromPaths []string, toBoxID, toPath string, callback interface{}) } } + // A progress layer appears when moving more than 16 documents at once https://github.com/siyuan-note/siyuan/issues/9356 needShowProgress := 16 < len(fromPaths) if needShowProgress { - util.PushEndlessProgress(Conf.Language(116)) + defer util.PushClearProgress() } WaitForWritingFiles() luteEngine := util.NewLute() + count := 0 for fromPath, fromBox := range pathsBoxes { + count++ + if needShowProgress { + util.PushEndlessProgress(fmt.Sprintf(Conf.Language(70), fmt.Sprintf("%d/%d", count, len(fromPaths)))) + } + _, err = moveDoc(fromBox, fromPath, toBox, toPath, luteEngine, callback) if nil != err { return @@ -1139,12 +1146,6 @@ func MoveDocs(fromPaths []string, toBoxID, toPath string, callback interface{}) } cache.ClearDocsIAL() IncSync() - - if needShowProgress { - util.PushEndlessProgress(Conf.Language(113)) - sql.WaitForWritingDatabase() - util.ReloadUI() - } return }