File tree Expand file tree Collapse file tree 4 files changed +15
-14
lines changed
graph-parser/src/logseq/graph_parser
outliner/src/logseq/outliner Expand file tree Collapse file tree 4 files changed +15
-14
lines changed Original file line number Diff line number Diff line change 17911791 (split-pages-and-properties-tx pages-tx old-properties existing-pages (:import-state options) @(:upstream-properties tx-options))
17921792 ; ; _ (when (seq property-pages-tx) (cljs.pprint/pprint {:property-pages-tx property-pages-tx}))
17931793 ; ; Necessary to transact new property entities first so that block+page properties can be transacted next
1794- main-props-tx-report (ldb /transact! conn property-pages-tx {::new-graph? true ::path file})
1794+ main-props-tx-report (d /transact! conn property-pages-tx {::new-graph? true ::path file})
17951795 _ (save-from-tx property-pages-tx options)
17961796
17971797 classes-tx @(:classes-tx tx-options)
18171817 ; ; [:whiteboard-pages :pages-index :page-properties-tx :property-page-properties-tx :pages-tx' :classes-tx :blocks-index :blocks-tx]
18181818 ; ; [whiteboard-pages pages-index page-properties-tx property-page-properties-tx pages-tx' classes-tx blocks-index blocks-tx]))
18191819 ; ; _ (when (not (seq whiteboard-pages)) (cljs.pprint/pprint {#_:property-pages-tx #_property-pages-tx :pages-tx pages-tx :tx tx'}))
1820- main-tx-report (ldb /transact! conn tx' {::new-graph? true ::path file})
1820+ main-tx-report (d /transact! conn tx' {::new-graph? true ::path file})
18211821 _ (save-from-tx tx' options)
18221822
18231823 upstream-properties-tx
18241824 (build-upstream-properties-tx @conn @(:upstream-properties tx-options) (:import-state options) log-fn)
18251825 ; ; _ (when (seq upstream-properties-tx) (cljs.pprint/pprint {:upstream-properties-tx upstream-properties-tx}))
1826- upstream-tx-report (when (seq upstream-properties-tx) (ldb /transact! conn upstream-properties-tx {::new-graph? true ::path file}))
1826+ upstream-tx-report (when (seq upstream-properties-tx) (d /transact! conn upstream-properties-tx {::new-graph? true ::path file}))
18271827 _ (save-from-tx upstream-properties-tx options)]
18281828
18291829 ; ; Return all tx-reports that occurred in this fn as UI needs to know what changed
Original file line number Diff line number Diff line change 1212 " Modified copy of frontend.worker.pipeline/invoke-hooks that handles new DB graphs but
1313 doesn't handle updating DB graphs well yet e.g. doesn't handle :block/tx-id"
1414 [conn tx-report]
15- (when-not (:pipeline-replace ? (:tx-meta tx-report))
15+ (when-not (:transact-new-graph-refs ? (:tx-meta tx-report))
1616 ; ; TODO: Handle block edits with separate :block/refs rebuild as deleting property values is buggy
1717 (outliner-pipeline/transact-new-db-graph-refs conn tx-report)))
1818
Original file line number Diff line number Diff line change 147147 (let [{:keys [blocks]} (ds-report/get-blocks-and-pages tx-report)
148148 refs-tx-report (when-let [refs-tx (and (seq blocks) (rebuild-block-refs-tx tx-report blocks))]
149149 (ldb/transact! conn refs-tx (-> (:tx-meta tx-report)
150- (assoc :pipeline-replace ? true ))))]
150+ (assoc :transact-new-graph-refs ? true ))))]
151151 refs-tx-report))
Original file line number Diff line number Diff line change 431431
432432(defn invoke-hooks
433433 [repo conn {:keys [tx-meta] :as tx-report} context]
434- (let [{:keys [from-disk? new-graph?]} tx-meta]
435- (cond
436- (or from-disk? new-graph?)
437- {:tx-report tx-report}
434+ (let [{:keys [from-disk? new-graph? transact-new-graph-refs?]} tx-meta]
435+ (when-not transact-new-graph-refs?
436+ (cond
437+ (or from-disk? new-graph?)
438+ {:tx-report tx-report}
438439
439- (or (::gp-exporter/new-graph? tx-meta)
440- (and (::sqlite-export/imported-data? tx-meta) (:import-db? tx-meta)))
441- (invoke-hooks-for-imported-graph conn tx-report)
440+ (or (::gp-exporter/new-graph? tx-meta)
441+ (and (::sqlite-export/imported-data? tx-meta) (:import-db? tx-meta)))
442+ (invoke-hooks-for-imported-graph conn tx-report)
442443
443- :else
444- (invoke-hooks-default repo conn tx-report context))))
444+ :else
445+ (invoke-hooks-default repo conn tx-report context) ))))
You can’t perform that action at this time.
0 commit comments