mirror of
https://github.com/logseq/logseq.git
synced 2026-06-02 19:31:24 +00:00
fix: enable pipeline set input content for db graphs only
This commit is contained in:
@@ -25,17 +25,19 @@
|
||||
|
||||
(defn- reset-editing-block-content!
|
||||
[tx-data]
|
||||
(when-let [edit-block (state/get-edit-block)]
|
||||
(when-let [last-datom (-> (filter (fn [datom]
|
||||
(and (= :block/content (:a datom))
|
||||
(= (:e datom) (:db/id edit-block)))) tx-data)
|
||||
last)]
|
||||
(when-let [input (state/get-input)]
|
||||
(when (:added last-datom)
|
||||
(let [db-content (:block/content (db/entity (:e last-datom)))]
|
||||
(when (not= (string/trim db-content)
|
||||
(string/trim (.-value input)))
|
||||
(state/set-edit-content! input db-content))))))))
|
||||
(let [repo (state/get-current-repo)]
|
||||
(when (config/db-based-graph? repo)
|
||||
(when-let [edit-block (state/get-edit-block)]
|
||||
(when-let [last-datom (-> (filter (fn [datom]
|
||||
(and (= :block/content (:a datom))
|
||||
(= (:e datom) (:db/id edit-block)))) tx-data)
|
||||
last)]
|
||||
(when-let [input (state/get-input)]
|
||||
(when (:added last-datom)
|
||||
(let [db-content (:block/content (db/entity (:e last-datom)))]
|
||||
(when (not= (string/trim db-content)
|
||||
(string/trim (.-value input)))
|
||||
(state/set-edit-content! input db-content))))))))))
|
||||
|
||||
(defn invoke-hooks
|
||||
[tx-report]
|
||||
|
||||
Reference in New Issue
Block a user