mirror of
https://github.com/logseq/logseq.git
synced 2026-05-03 02:16:30 +00:00
enhance: run db validate before writes
This commit is contained in:
@@ -883,9 +883,19 @@
|
||||
(reset! *service [graph service])
|
||||
service)))))
|
||||
|
||||
(defn- notify-invalid-data
|
||||
[{:keys [tx-meta]}]
|
||||
;; don't notify on production when undo/redo failed
|
||||
(when-not (and (or (:undo? tx-meta) (:redo? tx-meta))
|
||||
(not worker-util/dev?))
|
||||
(shared-service/broadcast-to-clients! :notification
|
||||
[["Invalid DB!"] :error])))
|
||||
|
||||
(defn init
|
||||
"web worker entry"
|
||||
[]
|
||||
(ldb/register-transact-invalid-callback-fn! notify-invalid-data)
|
||||
|
||||
(let [proxy-object (->>
|
||||
fns
|
||||
(map
|
||||
|
||||
Reference in New Issue
Block a user