🐛 Data sync may cause data loss on Android 14 https://github.com/siyuan-note/siyuan/issues/10205

This commit is contained in:
Daniel 2024-01-21 21:27:50 +08:00
parent dfe8f1317c
commit c00dc1cc5c
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
13 changed files with 36 additions and 33 deletions

View file

@ -97,11 +97,10 @@ func SearchTemplate(keyword string) (ret []*Block) {
if group.IsDir() {
var templateBlocks []*Block
templateDir := filepath.Join(templates, group.Name())
// filepath.Walk 与 filepath.WalkDir 均不支持跟踪符号链接
filepath.WalkDir(templateDir, func(path string, entry fs.DirEntry, err error) error {
name := strings.ToLower(entry.Name())
filelock.Walk(templateDir, func(path string, info fs.FileInfo, err error) error {
name := strings.ToLower(info.Name())
if strings.HasPrefix(name, ".") {
if entry.IsDir() {
if info.IsDir() {
return filepath.SkipDir
}
return nil