mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
refactor: use namespaced keyword for block export
instead of confusing :build/block. Also improved related tests, simplified import steps, added some missing sqlite.build docs, and fixed :build/uuid not working for some existing journals.
This commit is contained in:
@@ -69,7 +69,7 @@
|
||||
|
||||
(defn- import-submit [import-inputs _e]
|
||||
(let [export-map (try (edn/read-string (:import-data @import-inputs)) (catch :default _err ::invalid-import))
|
||||
import-block? (:build/block export-map)
|
||||
import-block? (::sqlite-export/block export-map)
|
||||
block (when import-block?
|
||||
(if-let [eid (:block-id (first (state/get-editor-args)))]
|
||||
(db/entity [:block/uuid eid])
|
||||
@@ -77,9 +77,9 @@
|
||||
(if (= ::invalid-import export-map)
|
||||
(notification/show! "The submitted EDN data is invalid! Fix and try again." :warning)
|
||||
(let [{:keys [init-tx block-props-tx error] :as txs}
|
||||
(sqlite-export/build-import (db/get-db)
|
||||
(when block {:current-block block})
|
||||
export-map)]
|
||||
(sqlite-export/build-import export-map
|
||||
(db/get-db)
|
||||
(when block {:current-block block}))]
|
||||
(pprint/pprint txs)
|
||||
(if error
|
||||
(notification/show! error :error)
|
||||
|
||||
Reference in New Issue
Block a user