From 4125a61fc6516a23baa7696c48d67b05ba93772f Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 17 May 2023 10:11:00 +0800 Subject: [PATCH] :bug: Custom sorting not maintained after importing .sy.zip Fix https://github.com/siyuan-note/siyuan/issues/8283 --- kernel/model/import.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/model/import.go b/kernel/model/import.go index e5d48d6ed..185b1accb 100644 --- a/kernel/model/import.go +++ b/kernel/model/import.go @@ -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) + } } // 重命名文件路径