From 92c8a2eb19af7b7dc8e8077a4a4159433ab47e46 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Mon, 26 Jun 2023 17:37:04 +0800 Subject: [PATCH] fix: add schema validation --- src/main/frontend/handler/editor/impl/db.cljs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/frontend/handler/editor/impl/db.cljs b/src/main/frontend/handler/editor/impl/db.cljs index f84c0dc39b..9714909ab8 100644 --- a/src/main/frontend/handler/editor/impl/db.cljs +++ b/src/main/frontend/handler/editor/impl/db.cljs @@ -8,7 +8,9 @@ [frontend.util :as util] [logseq.graph-parser.mldoc :as gp-mldoc] [logseq.graph-parser.util.page-ref :as page-ref] - [frontend.handler.ui :as ui-handler])) + [frontend.handler.ui :as ui-handler] + [frontend.handler.common.config-edn :as config-edn-common-handler] + [frontend.schema.handler.repo-config :as repo-config-schema])) (defn- remove-non-existed-refs! [refs] @@ -87,6 +89,10 @@ (defn save-file! [path content] (when path + (when (= path "logseq/config.edn") + (config-edn-common-handler/detect-deprecations path content) + (config-edn-common-handler/validate-config-edn path content repo-config-schema/Config-edn)) + (db/transact! [{:file/path path :file/content content}]) (when (= path "logseq/custom.css")