From 627d9366260925b6d3b5e95d1532cbf2bed7f131 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Tue, 19 Mar 2024 14:26:00 +0800 Subject: [PATCH] fix: use existing db/id for :graph/uuid --- deps/db/src/logseq/db/sqlite/common_db.cljs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deps/db/src/logseq/db/sqlite/common_db.cljs b/deps/db/src/logseq/db/sqlite/common_db.cljs index ffc1415cc..47ae7733f 100644 --- a/deps/db/src/logseq/db/sqlite/common_db.cljs +++ b/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)