Browse Source

fix: don't export file paths

Tienson Qin 4 years ago
parent
commit
3e7392c78c

+ 1 - 1
src/main/frontend/components/header.cljs

@@ -100,7 +100,7 @@
           :options {:href (rfe/href :all-pages)}
           :icon svg/pages-sm})
 
-       (when current-repo
+       (when (and current-repo (not config/publishing?))
          {:title (t :all-files)
           :options {:href (rfe/href :all-files)}
           :icon svg/folder-sm})

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

@@ -4,8 +4,6 @@
             [frontend.db-schema :as db-schema]
             [frontend.state :as state]))
 
-(defonce debug-db (atom nil))
-
 (defn- migrate-attribute
   [f]
   (if (and (keyword? f) (= "page" (namespace f)))
@@ -27,7 +25,5 @@
 
 (defn migrate
   [repo db]
-  (prn "Migrate DB")
-  (reset! debug-db db)
   (state/pub-event! [:graph/migrated repo])
   (with-schema db db-schema/schema))

+ 9 - 8
src/main/frontend/db/model.cljs

@@ -1151,14 +1151,15 @@
             filtered-db (d/filter db
                                   (fn [db datom]
                                     (let [ns (namespace (:a datom))]
-                                      (or
-                                       (not (exported-namespace? ns))
-                                       ;; (and (= ns "page")
-                                       ;;      (contains? public-pages (:e datom)))
-                                       (and (= ns "block")
-                                            (or
-                                             (contains? public-pages (:e datom))
-                                             (contains? public-pages (:db/id (:block/page (d/entity db (:e datom)))))))))))
+                                      (and
+                                       (not (contains? #{:block/file} (:a datom)))
+                                       (not= ns "file")
+                                       (or
+                                        (not (exported-namespace? ns))
+                                        (and (= ns "block")
+                                             (or
+                                              (contains? public-pages (:e datom))
+                                              (contains? public-pages (:db/id (:block/page (d/entity db (:e datom))))))))))))
             datoms (d/datoms filtered-db :eavt)
             assets (get-assets datoms)]
         [@(d/conn-from-datoms datoms db-schema/schema) assets]))))