fix: pprint/pprint not always work for validate errors

This commit is contained in:
Tienson Qin
2025-01-06 21:25:23 +08:00
parent d504ba36f1
commit a45da56cd2

View File

@@ -1,7 +1,6 @@
(ns frontend.worker.db.validate
"Validate db"
(:require [cljs.pprint :as pprint]
[frontend.worker.util :as worker-util]
(:require [frontend.worker.util :as worker-util]
[logseq.db.frontend.validate :as db-validate]))
(defn validate-db
@@ -12,11 +11,11 @@
(worker-util/post-message :log [:db-invalid :error
{:msg (str "Validation detected " (count errors) " invalid block(s):")
:counts (assoc (db-validate/graph-counts db entities) :datoms datom-count)}])
(pprint/pprint errors)
(prn errors)
(worker-util/post-message :notification
[(str "Validation detected " (count errors) " invalid block(s). These blocks may be buggy when you interact with them. See the javascript console for more.")
:warning false]))
(worker-util/post-message :notification
[(str "Your graph is valid! " (assoc (db-validate/graph-counts db entities) :datoms datom-count))
:success false]))))
:success false]))))