Explorar o código

fix: remove orphaned Pages will delete namespace pages

addressed #3682
Tienson Qin %!s(int64=4) %!d(string=hai) anos
pai
achega
7ab0265e47
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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?))]