Browse Source

Merge branch 'feat/db' of https://github.com/logseq/logseq into feat/db

charlie 1 year ago
parent
commit
201fc32d10
1 changed files with 11 additions and 7 deletions
  1. 11 7
      src/main/frontend/handler/db_based/recent.cljs

+ 11 - 7
src/main/frontend/handler/db_based/recent.cljs

@@ -3,7 +3,8 @@
   (:require [frontend.db :as db]
   (:require [frontend.db :as db]
             [frontend.state :as state]
             [frontend.state :as state]
             [clojure.string :as string]
             [clojure.string :as string]
-            [frontend.handler.property.util :as pu]))
+            [frontend.handler.property.util :as pu]
+            [logseq.db :as ldb]))
 
 
 (defn add-page-to-recent!
 (defn add-page-to-recent!
   [page click-from-recent?]
   [page click-from-recent?]
@@ -11,11 +12,13 @@
     (when-let [page-uuid (if (uuid? page)
     (when-let [page-uuid (if (uuid? page)
                            nil
                            nil
                            (pu/get-page-uuid page))]
                            (pu/get-page-uuid page))]
-      (let [pages (state/get-recent-pages)]
-        (when (or (and click-from-recent? (not ((set pages) page-uuid)))
-                  (not click-from-recent?))
-          (let [new-pages (vec (take 15 (distinct (cons page-uuid pages))))]
-            (state/set-recent-pages! new-pages)))))))
+      (when-let [page (db/entity [:block/uuid page-uuid])]
+        (when-not (ldb/hidden-page? page)
+          (let [pages (state/get-recent-pages)]
+            (when (or (and click-from-recent? (not ((set pages) page-uuid)))
+                      (not click-from-recent?))
+              (let [new-pages (vec (take 15 (distinct (cons page-uuid pages))))]
+                (state/set-recent-pages! new-pages)))))))))
 
 
 (defn get-recent-pages
 (defn get-recent-pages
   []
   []
@@ -24,4 +27,5 @@
        (map (fn [id]
        (map (fn [id]
               (let [e (db/entity [:block/uuid id])]
               (let [e (db/entity [:block/uuid id])]
                 (:block/original-name e))))
                 (:block/original-name e))))
-       (remove string/blank?)))
+       (remove string/blank?)
+       (remove ldb/hidden-page?)))