Skip to content

Commit b7edc5c

Browse files
committed
fix: hidden columns
1 parent de0d0cd commit b7edc5c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/frontend/worker/db/validate.cljs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@
117117
[:db/add (:e d) new-db-ident (:v d)]])))))))))
118118
;; FIXME: :logseq.property.table/hidden-columns should be :property type to avoid issues like this
119119
hidden-columns-tx-data (->> (d/datoms db :avet :logseq.property.table/hidden-columns)
120-
(keep (fn [d]
121-
(when (re-find #"^(\d)" (name (:v d)))
122-
(let [new-value (keyword (namespace (:v d)) (string/replace-first (name (:v d)) #"^(\d)" "NUM-$1"))]
123-
[:db/add (:e d) (:a d) new-value])))))
120+
(mapcat (fn [d]
121+
(when (re-find #"^(\d)" (name (:v d)))
122+
(let [new-value (keyword (namespace (:v d)) (string/replace-first (name (:v d)) #"^(\d)" "NUM-$1"))]
123+
[[:db/retract (:e d) (:a d) (:v d)]
124+
[:db/add (:e d) (:a d) new-value]])))))
124125
tx-data' (concat tx-data hidden-columns-tx-data)]
125126
(when (seq tx-data')
126127
(ldb/transact! conn tx-data'))))

0 commit comments

Comments
 (0)