Переглянути джерело

fix: use existing db/id for :graph/uuid

Tienson Qin 1 рік тому
батько
коміт
627d936626
1 змінених файлів з 6 додано та 2 видалено
  1. 6 2
      deps/db/src/logseq/db/sqlite/common_db.cljs

+ 6 - 2
deps/db/src/logseq/db/sqlite/common_db.cljs

@@ -155,8 +155,12 @@
   "Returns initial data"
   [db]
   (let [idents (remove nil?
-                       (when-let [id (:graph/uuid (d/entity db :graph/uuid))]
-                         [{:db/ident :graph/uuid :graph/uuid id}]))
+                       (let [e (d/entity db :graph/uuid)
+                             id (:graph/uuid e)]
+                         (when id
+                           [{:db/id (:db/id e)
+                             :db/ident :graph/uuid
+                             :graph/uuid id}])))
         favorites (get-favorites db)
         latest-journals (get-latest-journals db 3)
         all-files (get-all-files db)