Kaynağa Gözat

fix: remove orphaned Pages will delete namespace pages

addressed #3682
Tienson Qin 4 yıl önce
ebeveyn
işleme
7ab0265e47
1 değiştirilmiş dosya ile 4 ekleme ve 0 silme
  1. 4 0
      src/main/frontend/db/model.cljs

+ 4 - 0
src/main/frontend/db/model.cljs

@@ -1514,6 +1514,10 @@
                                      (= 1 (count children))
                                      (contains? #{"" "-" "*"} (string/trim (:block/content first-child))))))
                                  (not (contains? built-in-pages name))
+                                 (not (:block/_namespace page))
+                                 ;; a/b/c might be deleted but a/b/c/d still exists (for backward compatibility)
+                                 (not (and (string/includes? name "/")
+                                           (not (:block/journal? page))))
                                  page))))
                           pages)
                         (remove false?))]