mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
fix: refs not built for imported EDN
from UI form or when using cli in-app graph
This commit is contained in:
@@ -126,8 +126,7 @@
|
|||||||
;; (cljs.pprint/pprint _txs)
|
;; (cljs.pprint/pprint _txs)
|
||||||
(when error
|
(when error
|
||||||
(throw (ex-info (str "Error while building import data: " error) {})))
|
(throw (ex-info (str "Error while building import data: " error) {})))
|
||||||
(let [tx-meta {::sqlite-export/imported-data? true
|
(let [tx-meta {::sqlite-export/imported-data? true}]
|
||||||
:import-db? true}]
|
|
||||||
(ldb/transact! conn (vec (concat init-tx block-props-tx misc-tx)) tx-meta))))
|
(ldb/transact! conn (vec (concat init-tx block-props-tx misc-tx)) tx-meta))))
|
||||||
|
|
||||||
(defn- get-ident [idents title]
|
(defn- get-ident [idents title]
|
||||||
|
|||||||
@@ -518,8 +518,13 @@
|
|||||||
(or from-disk? new-graph?)
|
(or from-disk? new-graph?)
|
||||||
{:tx-report tx-report}
|
{:tx-report tx-report}
|
||||||
|
|
||||||
|
;; Rebuild refs for a new DB graph using EDN or when EDN data is imported.
|
||||||
|
;; Ref rebuilding happens here because transact-pipeline doesn't rebuild refs
|
||||||
|
;; for these cases
|
||||||
(or (::gp-exporter/new-graph? tx-meta)
|
(or (::gp-exporter/new-graph? tx-meta)
|
||||||
(and (::sqlite-export/imported-data? tx-meta) (:import-db? tx-meta)))
|
(and (::sqlite-export/imported-data? tx-meta)
|
||||||
|
;; Undo and redo must be handled by default in order to work
|
||||||
|
(not (:undo? tx-meta)) (not (:redo? tx-meta))))
|
||||||
(invoke-hooks-for-imported-graph conn tx-report)
|
(invoke-hooks-for-imported-graph conn tx-report)
|
||||||
|
|
||||||
:else
|
:else
|
||||||
|
|||||||
Reference in New Issue
Block a user