🐛 After the document is transferred to the heading, occurs two copies of the reference block Fix https://github.com/siyuan-note/siyuan/issues/7819

This commit is contained in:
Liang Ding 2023-03-29 19:38:03 +08:00
parent c804ce77fc
commit ee7ab26fcd
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 31 additions and 1 deletions

View file

@ -47,3 +47,13 @@ func upsertRefs(tx *sql.Tx, tree *parse.Tree) (err error) {
err = insertRefs(tx, tree)
return
}
func deleteRefs(tx *sql.Tx, tree *parse.Tree) (err error) {
if err = deleteRefsByPath(tx, tree.Box, tree.Path); nil != err {
return
}
if err = deleteFileAnnotationRefsByPath(tx, tree.Box, tree.Path); nil != err {
return
}
return
}