Skip to content

Commit ace82d7

Browse files
committed
fix: don't create new card page when importing file graph
fix logseq/db-test#521
1 parent 263c499 commit ace82d7

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

deps/graph-parser/src/logseq/graph_parser/exporter.cljs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,14 +1382,16 @@
13821382
(or (all-existing-page-uuids (:block/name page))
13831383
(throw (ex-info (str "No uuid found for existing namespace page " (pr-str (:block/name page)))
13841384
(select-keys page [:block/name :block/namespace]))))))
1385-
(cond-> page
1386-
;; fix extract incorrectly assigning new user pages built-in uuids
1387-
(contains? all-built-in-names (keyword (:block/name page)))
1388-
(assoc :block/uuid (d/squuid))
1389-
;; only happens for few file built-ins like tags and alias
1390-
(and (contains? all-built-in-names (keyword (:block/name page)))
1391-
(not (:block/tags page)))
1392-
(assoc :block/tags [:logseq.class/Page])))]
1385+
(let [built-in-name? (and (contains? all-built-in-names (keyword (:block/name page)))
1386+
;; Don't create new card page
1387+
(not (contains? #{:card} (keyword (:block/name page)))))]
1388+
(cond-> page
1389+
;; fix extract incorrectly assigning new user pages built-in uuids
1390+
built-in-name?
1391+
(assoc :block/uuid (d/squuid))
1392+
;; only happens for few file built-ins like tags and alias
1393+
(and built-in-name? (not (:block/tags page)))
1394+
(assoc :block/tags [:logseq.class/Page]))))]
13931395
(cond-> page'
13941396
true
13951397
(dissoc :block/format)

0 commit comments

Comments
 (0)