mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-11 23:22:33 +01:00
🎨 Improve document tree custom sorting stability when creating a notebook or doc https://github.com/siyuan-note/siyuan/issues/15716
This commit is contained in:
parent
c17a09d37e
commit
6c1156afc8
2 changed files with 12 additions and 1 deletions
|
|
@ -50,6 +50,13 @@ func CreateBox(name string) (id string, err error) {
|
|||
createDocLock.Lock()
|
||||
defer createDocLock.Unlock()
|
||||
|
||||
boxes, _ := ListNotebooks()
|
||||
for i, b := range boxes {
|
||||
c := b.GetConf()
|
||||
c.Sort = i + 1
|
||||
b.SaveConf(c)
|
||||
}
|
||||
|
||||
id = ast.NewNodeID()
|
||||
boxLocalPath := filepath.Join(util.DataDir, id)
|
||||
err = os.MkdirAll(boxLocalPath, 0755)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue