From ad79dd64b7e271a4ccee3ffb659c10c6b81943e0 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 27 Jan 2023 11:44:46 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=AF=BC=E5=85=A5=20Markdown=20?= =?UTF-8?q?=E5=92=8C=20`.sy.zip`=20=E6=97=B6=E5=A2=9E=E9=87=8F=E5=BB=BA?= =?UTF-8?q?=E7=AB=8B=E7=B4=A2=E5=BC=95=20https://github.com/siyuan-note/si?= =?UTF-8?q?yuan/issues/7123?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/import.go | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/kernel/model/import.go b/kernel/model/import.go index 3dd5dc16d..8df17c22c 100644 --- a/kernel/model/import.go +++ b/kernel/model/import.go @@ -610,22 +610,14 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) { }) reassignIDUpdated(tree) - if err = filesys.WriteTree(tree); nil != err { - return io.EOF - } + indexWriteJSONQueue(tree) + i++ if 0 == i%4 { util.PushEndlessProgress(fmt.Sprintf(Conf.Language(66), util.ShortPathForBootingDisplay(tree.Path))) } return nil }) - - if nil != err { - return err - } - - IncSync() - FullReindex() } else { // 导入单个文件 fileName := filepath.Base(localPath) if !strings.HasSuffix(fileName, ".md") && !strings.HasSuffix(fileName, ".markdown") { @@ -703,13 +695,11 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) { }) reassignIDUpdated(tree) - if err = indexWriteJSONQueue(tree); nil != err { - return - } - IncSync() + indexWriteJSONQueue(tree) } IncSync() + ReloadUI() runtime.GC() return }