mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 Improve update tx
This commit is contained in:
parent
49c076b4e5
commit
205e4a8436
1 changed files with 9 additions and 9 deletions
|
|
@ -454,9 +454,9 @@ func (tx *Transaction) doPrependInsert(operation *Operation) (ret *TxErr) {
|
||||||
var err error
|
var err error
|
||||||
block := treenode.GetBlockTree(operation.ParentID)
|
block := treenode.GetBlockTree(operation.ParentID)
|
||||||
if nil == block {
|
if nil == block {
|
||||||
msg := fmt.Sprintf("not found parent block [%s]", operation.ParentID)
|
logging.LogErrorf("not found parent block [%s]", operation.ParentID)
|
||||||
logging.LogErrorf(msg)
|
util.ReloadUI() // 比如分屏后编辑器状态不一致,这里强制重新载入界面
|
||||||
return &TxErr{code: TxErrCodeBlockNotFound, id: operation.ParentID}
|
return
|
||||||
}
|
}
|
||||||
tree, err := tx.loadTree(block.ID)
|
tree, err := tx.loadTree(block.ID)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
|
|
@ -538,9 +538,9 @@ func (tx *Transaction) doAppendInsert(operation *Operation) (ret *TxErr) {
|
||||||
var err error
|
var err error
|
||||||
block := treenode.GetBlockTree(operation.ParentID)
|
block := treenode.GetBlockTree(operation.ParentID)
|
||||||
if nil == block {
|
if nil == block {
|
||||||
msg := fmt.Sprintf("not found parent block [%s]", operation.ParentID)
|
logging.LogErrorf("not found parent block [%s]", operation.ParentID)
|
||||||
logging.LogErrorf(msg)
|
util.ReloadUI() // 比如分屏后编辑器状态不一致,这里强制重新载入界面
|
||||||
return &TxErr{code: TxErrCodeBlockNotFound, id: operation.ParentID}
|
return
|
||||||
}
|
}
|
||||||
tree, err := tx.loadTree(block.ID)
|
tree, err := tx.loadTree(block.ID)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
|
|
@ -779,9 +779,9 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if nil == block {
|
if nil == block {
|
||||||
msg := fmt.Sprintf("not found next block [%s]", operation.NextID)
|
logging.LogErrorf("not found block [%s, %s, %s]", operation.ParentID, operation.PreviousID, operation.NextID)
|
||||||
logging.LogErrorf(msg)
|
util.ReloadUI() // 比如分屏后编辑器状态不一致,这里强制重新载入界面
|
||||||
return &TxErr{code: TxErrCodeBlockNotFound, id: operation.NextID}
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
tree, err := tx.loadTree(block.ID)
|
tree, err := tx.loadTree(block.ID)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue