Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Apr 10, 2024
2 parents 98843fc + fc32639 commit 1fc1695
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/appearance/langs/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,7 @@
"238": "Marketplace package [%s] update failed, please try again later",
"239": "Related operations are being processed, please try again later",
"240": "Drag heading under container blocks in the doc is not supported",
"241": "Drag to its subheading is not supported"
"241": "Drag to its subheading is not supported",
"242": "The binding block already exists in the current database"
}
}
3 changes: 2 additions & 1 deletion app/appearance/langs/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,7 @@
"238": "Error en la actualización del paquete Marketplace [%s], inténtalo de nuevo más tarde",
"239": "Las operaciones relacionadas se están procesando, inténtalo de nuevo más tarde",
"240": "No se admite arrastrar encabezado debajo de los bloques contenedores en el documento",
"241": "No se admite arrastrar a su subtítulo"
"241": "No se admite arrastrar a su subtítulo",
"242": "El bloque de enlace ya existe en la base de datos actual"
}
}
3 changes: 2 additions & 1 deletion app/appearance/langs/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,7 @@
"238": "La mise à jour du package Marketplace [%s] a échoué, veuillez réessayer plus tard",
"239": "Les opérations associées sont en cours de traitement, veuillez réessayer plus tard",
"240": "Le déplacement du titre sous les blocs conteneurs dans la doc n'est pas pris en charge",
"241": "Le glisser vers son sous-titre n'est pas pris en charge"
"241": "Le glisser vers son sous-titre n'est pas pris en charge",
"242": "Le bloc de liaison existe déjà dans la base de données actuelle"
}
}
3 changes: 2 additions & 1 deletion app/appearance/langs/zh_CHT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,7 @@
"238": "市集包 [%s] 更新失敗,請稍後再試",
"239": "相關操作正在處理中,請稍後再試",
"240": "不支援拖曳文件中容器區塊下的標題",
"241": "不支持拖曳為自己的子標題"
"241": "不支持拖曳為自己的子標題",
"242": "目前資料庫中已經存在該綁定區塊"
}
}
3 changes: 2 additions & 1 deletion app/appearance/langs/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,7 @@
"238": "集市包 [%s] 更新失败,请稍后再试",
"239": "相关操作正在处理中,请稍后再试",
"240": "不支持拖拽文档中容器块下的标题",
"241": "不支持拖拽为自己的子标题"
"241": "不支持拖拽为自己的子标题",
"242": "当前数据库中已经存在该绑定块"
}
}
12 changes: 12 additions & 0 deletions kernel/model/attribute_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -2129,6 +2129,7 @@ func addAttributeViewBlock(avID, blockID, previousBlockID, addingBlockID string,
blockValue.IsDetached = isDetached
blockValue.Block.Content = content
blockValue.UpdatedAt = now
util.PushMsg(Conf.language(242), 3000)
err = av.SaveAttributeView(attrView)
}
return
Expand Down Expand Up @@ -2869,6 +2870,17 @@ func replaceAttributeViewBlock(operation *Operation, tx *Transaction) (err error
node, _, _ = getNodeByBlockID(tx, operation.NextID)
}

// 检查是否已经存在绑定块
// Improve database primary key binding block https://github.com/siyuan-note/siyuan/issues/10945
for _, keyValues := range attrView.KeyValues {
for _, value := range keyValues.Values {
if value.BlockID == operation.NextID {
util.PushMsg(Conf.language(242), 3000)
return
}
}
}

for _, keyValues := range attrView.KeyValues {
for _, value := range keyValues.Values {
if value.BlockID == operation.PreviousID {
Expand Down

0 comments on commit 1fc1695

Please sign in to comment.