Selaa lähdekoodia

fix: wrong namespace if nested_link exists in page

Let's say, if we have a page named `[[A/B]] is a page` in the graph,
logseq creates two wrong namespaces: `[[A` and `B]] is a page`, this
PR points the namespace to `A` and `B`
leizhe 4 vuotta sitten
vanhempi
sitoutus
69c9fce9d4
1 muutettua tiedostoa jossa 8 lisäystä ja 7 poistoa
  1. 8 7
      src/main/frontend/components/hierarchy.cljs

+ 8 - 7
src/main/frontend/components/hierarchy.cljs

@@ -11,13 +11,14 @@
 ;; FIXME: use block/namespace to get the relation
 (defn get-relation
   [page]
-  (when (text/namespace-page? page)
-    (->> (db/get-namespace-pages (state/get-current-repo) page)
-         (map (fn [page]
-                (or (:block/original-name page) (:block/name page))))
-         (map #(string/split % #"/"))
-         (remove #(= % [page]))
-         (sort))))
+  (when-let [page (or (text/get-nested-page-name page) page)]
+   (when (text/namespace-page? page)
+     (->> (db/get-namespace-pages (state/get-current-repo) page)
+          (map (fn [page]
+                 (or (:block/original-name page) (:block/name page))))
+          (map #(string/split % #"/"))
+          (remove #(= % [page]))
+          (sort)))))
 
 (rum/defc structures
   [page]