mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-21 03:21:21 +08:00
🎨 文档未索引的情况下文档树打开文档返回报错消息
This commit is contained in:
parent
b077aaef9f
commit
e3e50e9cff
@ -44,9 +44,6 @@ export const openFileById = (options: {
|
||||
lockFile(data.data);
|
||||
return;
|
||||
}
|
||||
if (data.code === 1) {
|
||||
showMessage(data.msg);
|
||||
}
|
||||
openFile({
|
||||
fileName: data.data.rootTitle,
|
||||
rootIcon: data.data.rootIcon,
|
||||
|
@ -49,10 +49,6 @@ export const openMobileFileById = (id: string, hasContext?: boolean, action = [C
|
||||
lockFile(data.data);
|
||||
return;
|
||||
}
|
||||
if (data.code === 1) {
|
||||
showMessage(data.msg);
|
||||
return;
|
||||
}
|
||||
if (window.siyuan.mobileEditor) {
|
||||
addLoading(window.siyuan.mobileEditor.protyle);
|
||||
fetchPost("/api/filetree/getDoc", {
|
||||
|
@ -93,6 +93,11 @@ func getDocInfo(c *gin.Context) {
|
||||
|
||||
id := arg["id"].(string)
|
||||
info := model.GetDocInfo(id)
|
||||
if nil == info {
|
||||
ret.Code = -1
|
||||
ret.Msg = fmt.Sprintf(model.Conf.Language(15), id)
|
||||
return
|
||||
}
|
||||
ret.Data = info
|
||||
}
|
||||
|
||||
@ -266,7 +271,7 @@ func getBlockInfo(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if nil == block {
|
||||
ret.Code = 1
|
||||
ret.Code = -1
|
||||
ret.Msg = fmt.Sprintf(model.Conf.Language(15), id)
|
||||
return
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ func GetDocInfo(rootID string) (ret *BlockInfo) {
|
||||
|
||||
tree, err := loadTreeByBlockID(rootID)
|
||||
if nil != err {
|
||||
util.LogErrorf("load tree by block id failed: %s", err)
|
||||
util.LogErrorf("load tree by root id [%s] failed: %s", rootID, err)
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user