浏览代码

fix: restore to empty string after deleting the last block value

Tienson Qin 1 年之前
父节点
当前提交
caa0763cee
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. 1 0
      src/main/frontend/db_worker.cljs
  2. 1 1
      src/main/frontend/worker/pipeline.cljs

+ 1 - 0
src/main/frontend/db_worker.cljs

@@ -392,6 +392,7 @@
                         (ldb/get-page @conn (:today-journal-name tx-meta))) ; today journal created already
                         (ldb/get-page @conn (:today-journal-name tx-meta))) ; today journal created already
 
 
            ;; (prn :debug :transact :tx-data tx-data' :tx-meta tx-meta')
            ;; (prn :debug :transact :tx-data tx-data' :tx-meta tx-meta')
+
            (worker-util/profile "Worker db transact"
            (worker-util/profile "Worker db transact"
                                 (ldb/transact! conn tx-data' tx-meta')))
                                 (ldb/transact! conn tx-data' tx-meta')))
          nil)
          nil)

+ 1 - 1
src/main/frontend/worker/pipeline.cljs

@@ -42,7 +42,7 @@
                        created-block (d/entity after-db (:db/id created-from-block))]
                        created-block (d/entity after-db (:db/id created-from-block))]
                    (when (and created-block created-from-property)
                    (when (and created-block created-from-property)
                      [[:db/retractEntity (:db/id b)]
                      [[:db/retractEntity (:db/id b)]
-                      [:db/add (:db/id created-block) (:db/id created-from-property) ""]])))
+                      [:db/add (:db/id created-block) (:db/ident created-from-property) ""]])))
                empty-property-parents)
                empty-property-parents)
        (remove nil?)))))
        (remove nil?)))))