|
|
@@ -3,7 +3,8 @@
|
|
|
(:require [frontend.db :as db]
|
|
|
[frontend.state :as state]
|
|
|
[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!
|
|
|
[page click-from-recent?]
|
|
|
@@ -11,11 +12,13 @@
|
|
|
(when-let [page-uuid (if (uuid? page)
|
|
|
nil
|
|
|
(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
|
|
|
[]
|
|
|
@@ -24,4 +27,5 @@
|
|
|
(map (fn [id]
|
|
|
(let [e (db/entity [:block/uuid id])]
|
|
|
(:block/original-name e))))
|
|
|
- (remove string/blank?)))
|
|
|
+ (remove string/blank?)
|
|
|
+ (remove ldb/hidden-page?)))
|