🐛 Custom sorting not maintained after importing .sy.zip Fix https://github.com/siyuan-note/siyuan/issues/8283

This commit is contained in:
Liang Ding 2023-05-17 10:11:00 +08:00
parent 9ab5657c4f
commit 4125a61fc6
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -243,13 +243,16 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
sortData, sortErr = gulu.JSON.MarshalJSON(fullSortIDs)
if nil != sortErr {
logging.LogErrorf("marshal temp full sort conf failed: %s", sortErr)
logging.LogErrorf("marshal box full sort conf failed: %s", sortErr)
} else {
sortErr = filelock.WriteFile(sortPath, sortData)
sortErr = filelock.WriteFile(boxSortPath, sortData)
if nil != sortErr {
logging.LogErrorf("write temp full sort conf failed: %s", sortErr)
logging.LogErrorf("write box full sort conf failed: %s", sortErr)
}
}
if removeErr := os.RemoveAll(sortPath); nil != removeErr {
logging.LogErrorf("remove temp sort conf failed: %s", removeErr)
}
}
// 重命名文件路径