mirror of https://github.com/logseq/logseq
fix: report error if the title property is not a text
related to https://sentry.io/organizations/logseq/issues/3638204936pull/7178/head
parent
3375bb0674
commit
a2322ecffb
|
@ -376,11 +376,13 @@
|
|||
|
||||
;; sanitized page name changed
|
||||
(when-let [title (get-in block' [:block/properties :title])]
|
||||
(when-let [old-page-name (:block/name (db/entity (:db/id (:block/page block'))))]
|
||||
(when (and (:block/pre-block? block')
|
||||
(not (string/blank? title))
|
||||
(not= (util/page-name-sanity-lc title) old-page-name))
|
||||
(state/pub-event! [:page/title-property-changed old-page-name title]))))))))
|
||||
(if (string? title)
|
||||
(when-let [old-page-name (:block/name (db/entity (:db/id (:block/page block'))))]
|
||||
(when (and (:block/pre-block? block')
|
||||
(not (string/blank? title))
|
||||
(not= (util/page-name-sanity-lc title) old-page-name))
|
||||
(state/pub-event! [:page/title-property-changed old-page-name title])))
|
||||
(js/console.error (str "Title is not a string: " title))))))))
|
||||
|
||||
(defn save-block-if-changed!
|
||||
([block value]
|
||||
|
|
Loading…
Reference in New Issue