This commit is contained in:
Liang Ding 2023-01-24 13:21:23 +08:00
parent 87f230023c
commit 801bc69820
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
7 changed files with 34 additions and 18 deletions

View file

@ -139,7 +139,6 @@ func Mount(boxID string) (alreadyMount bool, err error) {
WaitForWritingFiles()
localPath := filepath.Join(util.DataDir, boxID)
var reMountGuide bool
if IsUserGuide(boxID) {
// 重新挂载帮助文档
@ -200,6 +199,29 @@ func Mount(boxID string) (alreadyMount bool, err error) {
ListDocTree(box.ID, "/", Conf.FileTree.Sort)
treenode.SaveBlockTree(false)
util.ClearPushProgress(100)
if IsUserGuide(boxID) {
go func() {
var startID string
i := 0
for ; i < 70; i++ {
time.Sleep(100 * time.Millisecond)
guideStartID := map[string]string{
"20210808180117-czj9bvb": "20200812220555-lj3enxa",
"20211226090932-5lcq56f": "20211226115423-d5z1joq",
"20210808180117-6v0mkxr": "20200923234011-ieuun1p",
}
startID = guideStartID[boxID]
if nil != treenode.GetBlockTree(startID) {
util.BroadcastByType("main", "openFileById", 0, "", map[string]interface{}{
"id": startID,
})
break
}
}
}()
}
if reMountGuide {
return true, nil
}

View file

@ -293,7 +293,7 @@ func SetSyncGenerateConflictDoc(b bool) {
return
}
func SetSyncEnable(b bool) (err error) {
func SetSyncEnable(b bool) {
Conf.Sync.Enabled = b
Conf.Save()
return