mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
♻️ Extract method util.GetTreeID
This commit is contained in:
parent
c295a496d7
commit
6f7e106be4
11 changed files with 26 additions and 27 deletions
|
|
@ -21,7 +21,6 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
|
@ -293,7 +292,7 @@ func removeIndexes(removeFilePaths []string) (removeRootIDs []string) {
|
|||
continue
|
||||
}
|
||||
|
||||
id := strings.TrimSuffix(filepath.Base(removeFile), ".sy")
|
||||
id := util.GetTreeID(removeFile)
|
||||
removeRootIDs = append(removeRootIDs, id)
|
||||
block := treenode.GetBlockTree(id)
|
||||
if nil != block {
|
||||
|
|
@ -338,7 +337,7 @@ func upsertIndexes(upsertFilePaths []string) (upsertRootIDs []string) {
|
|||
|
||||
box := upsertFile[:idx]
|
||||
p := strings.TrimPrefix(upsertFile, box)
|
||||
msg := fmt.Sprintf(Conf.Language(40), strings.TrimSuffix(path.Base(p), ".sy"))
|
||||
msg := fmt.Sprintf(Conf.Language(40), util.GetTreeID(p))
|
||||
util.IncBootProgress(bootProgressPart, msg)
|
||||
util.PushStatusBar(msg)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue