FIX: Linked reference is not refresh after file altering #2694

pull/2777/head
Jiang Hailong 2021-09-01 20:54:13 +08:00 committed by Tienson Qin
parent 0550c8a876
commit 1ee0c240c3
1 changed files with 5 additions and 3 deletions

View File

@ -110,11 +110,13 @@
(set))
keep-block-ref-f (fn [refs]
(filter (fn [ref]
(when (and (vector? ref)
(= :block/uuid (first ref)))
(cond
(and (vector? ref) (= :block/uuid (first ref)))
(let [id (second ref)]
(or (contains? block-ids id)
(db/entity [:block/uuid id]))))) refs))]
(db/entity [:block/uuid id])))
(and (map? ref) (contains? ref :block/journal?))
(db/entity [:block/name (ref :block/name)]))) refs))]
(map (fn [item]
(update item :block/refs keep-block-ref-f))
data)))