🎨 改进网络图片转换本地图片消息提示 https://github.com/siyuan-note/siyuan/issues/5131

This commit is contained in:
Liang Ding 2022-06-09 10:08:44 +08:00
parent fcabf93cab
commit c536908cfd
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
5 changed files with 6 additions and 7 deletions

View file

@ -69,6 +69,7 @@ func NetImg2LocalAssets(rootID string) (err error) {
}
var files int
util.PushMsg(Conf.Language(119), 7000)
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
if !entering {
return ast.WalkContinue
@ -89,7 +90,6 @@ func NetImg2LocalAssets(rootID string) (err error) {
u = strings.Replace(u, "/0?", "/640?", 1)
}
}
util.PushMsg(fmt.Sprintf(Conf.Language(119), u), 15000)
request := util.NewBrowserRequest(Conf.System.NetworkProxy.String())
resp, reqErr := request.Get(u)
if nil != reqErr {
@ -146,9 +146,8 @@ func NetImg2LocalAssets(rootID string) (err error) {
}
return ast.WalkContinue
})
if 0 < files {
util.PushMsg(Conf.Language(113), 5000)
util.PushMsg(Conf.Language(113), 7000)
if err = writeJSONQueue(tree); nil != err {
return
}