Always add target of redirect-to-page! to 'Recent' list.

This change will put way more visited pages in the 'Recent' list, which (to me) feels better than the current behaviour.
This commit is contained in:
Moritz Ulrich
2021-12-03 10:20:08 +01:00
committed by Tienson Qin
parent 60d3f1f60e
commit d7759aeb79
3 changed files with 4 additions and 5 deletions

View File

@@ -3,6 +3,7 @@
[frontend.date :as date]
[frontend.db :as db]
[frontend.handler.ui :as ui-handler]
[frontend.handler.recent :as recent-handler]
[frontend.handler.search :as search-handler]
[frontend.state :as state]
[frontend.text :as text]
@@ -28,13 +29,16 @@
(defn redirect-to-page!
([page-name]
(recent-handler/add-page-to-recent! (state/get-current-repo) page-name)
(redirect! {:to :page
:path-params {:name (str page-name)}}))
([page-name anchor]
(recent-handler/add-page-to-recent! (state/get-current-repo) page-name)
(redirect! {:to :page
:path-params {:name (str page-name)}
:query-params {:anchor anchor}}))
([page-name anchor push]
(recent-handler/add-page-to-recent! (state/get-current-repo) page-name)
(redirect! {:to :page
:path-params {:name (str page-name)}
:query-params {:anchor anchor}