mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-21 19:41:05 +08:00
🐛 导入 .sy.zip
后丢失自定义排序 Fix https://github.com/siyuan-note/siyuan/issues/6611
This commit is contained in:
parent
ddee980f24
commit
171f7cf777
@ -190,9 +190,9 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||||||
logging.LogErrorf("unmarshal sort conf failed: %s", sortErr)
|
logging.LogErrorf("unmarshal sort conf failed: %s", sortErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
sortPath = filepath.Join(util.DataDir, boxID, ".siyuan", "sort.json")
|
boxSortPath := filepath.Join(util.DataDir, boxID, ".siyuan", "sort.json")
|
||||||
if gulu.File.IsExist(sortPath) {
|
if gulu.File.IsExist(boxSortPath) {
|
||||||
sortData, sortErr = filelock.ReadFile(sortPath)
|
sortData, sortErr = filelock.ReadFile(boxSortPath)
|
||||||
if nil != sortErr {
|
if nil != sortErr {
|
||||||
logging.LogErrorf("read box sort conf failed: %s", sortErr)
|
logging.LogErrorf("read box sort conf failed: %s", sortErr)
|
||||||
}
|
}
|
||||||
@ -210,11 +210,11 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||||||
|
|
||||||
sortData, sortErr = gulu.JSON.MarshalJSON(fullSortIDs)
|
sortData, sortErr = gulu.JSON.MarshalJSON(fullSortIDs)
|
||||||
if nil != sortErr {
|
if nil != sortErr {
|
||||||
logging.LogErrorf("marshal box sort conf failed: %s", sortErr)
|
logging.LogErrorf("marshal temp full sort conf failed: %s", sortErr)
|
||||||
} else {
|
} else {
|
||||||
sortErr = filelock.WriteFile(sortPath, sortData)
|
sortErr = filelock.WriteFile(sortPath, sortData)
|
||||||
if nil != sortErr {
|
if nil != sortErr {
|
||||||
logging.LogErrorf("write box sort conf failed: %s", sortErr)
|
logging.LogErrorf("write temp full sort conf failed: %s", sortErr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user