diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go index c5d72351d..921bc1306 100644 --- a/kernel/model/transaction.go +++ b/kernel/model/transaction.go @@ -454,9 +454,9 @@ func (tx *Transaction) doPrependInsert(operation *Operation) (ret *TxErr) { var err error block := treenode.GetBlockTree(operation.ParentID) if nil == block { - msg := fmt.Sprintf("not found parent block [%s]", operation.ParentID) - logging.LogErrorf(msg) - return &TxErr{code: TxErrCodeBlockNotFound, id: operation.ParentID} + logging.LogErrorf("not found parent block [%s]", operation.ParentID) + util.ReloadUI() // 比如分屏后编辑器状态不一致,这里强制重新载入界面 + return } tree, err := tx.loadTree(block.ID) if nil != err { @@ -538,9 +538,9 @@ func (tx *Transaction) doAppendInsert(operation *Operation) (ret *TxErr) { var err error block := treenode.GetBlockTree(operation.ParentID) if nil == block { - msg := fmt.Sprintf("not found parent block [%s]", operation.ParentID) - logging.LogErrorf(msg) - return &TxErr{code: TxErrCodeBlockNotFound, id: operation.ParentID} + logging.LogErrorf("not found parent block [%s]", operation.ParentID) + util.ReloadUI() // 比如分屏后编辑器状态不一致,这里强制重新载入界面 + return } tree, err := tx.loadTree(block.ID) if nil != err { @@ -779,9 +779,9 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) { } } if nil == block { - msg := fmt.Sprintf("not found next block [%s]", operation.NextID) - logging.LogErrorf(msg) - return &TxErr{code: TxErrCodeBlockNotFound, id: operation.NextID} + logging.LogErrorf("not found block [%s, %s, %s]", operation.ParentID, operation.PreviousID, operation.NextID) + util.ReloadUI() // 比如分屏后编辑器状态不一致,这里强制重新载入界面 + return } tree, err := tx.loadTree(block.ID)