Skip to content

Commit fec4f51

Browse files
committed
fix: set heading removes refs
related to logseq/db-test#559
1 parent d77ce05 commit fec4f51

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

deps/db/src/logseq/db/file_based/schema.cljs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@
104104
:block/marker :block/macros :block/type :block/format])
105105

106106
(def retract-attributes
107-
#{:block/refs
108-
:block/tags
107+
#{:block/tags
109108
:block/alias
110109
:block/marker
111110
:block/priority

deps/db/src/logseq/db/frontend/schema.cljs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@
7272
;; If only block/title changes
7373
(def retract-attributes
7474
"Retract attributes for DB graphs"
75-
#{:block/refs
76-
:block/warning})
75+
#{:block/warning})
7776

7877
;; DB graph helpers
7978
;; ================

src/main/frontend/handler/db_based/editor.cljs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
[frontend.handler.property :as property-handler]
1111
[frontend.handler.repo-config :as repo-config-handler]
1212
[frontend.handler.ui :as ui-handler]
13-
[frontend.modules.outliner.op :as outliner-op]
1413
[frontend.modules.outliner.ui :as ui-outliner-tx]
1514
[frontend.schema.handler.repo-config :as repo-config-schema]
1615
[frontend.state :as state]
@@ -97,8 +96,8 @@
9796
{:outliner-op :save-block}
9897
(doseq [id block-ids]
9998
(let [e (db/entity [:block/uuid id])
100-
title (commands/clear-markdown-heading (:block/title e))
101-
block {:block/uuid (:block/uuid e)
102-
:block/title title}]
103-
(outliner-op/save-block! block)))
99+
raw-title (:block/raw-title e)
100+
new-raw-title (commands/clear-markdown-heading raw-title)]
101+
(when (not= new-raw-title raw-title)
102+
(property-handler/set-block-property! repo id :block/title new-raw-title))))
104103
(property-handler/batch-set-block-property! repo block-ids :logseq.property/heading heading)))

0 commit comments

Comments
 (0)