mirror of
https://github.com/logseq/logseq.git
synced 2026-05-02 01:46:35 +00:00
slight refactor for clarity
This commit is contained in:
committed by
Tienson Qin
parent
46e3b3fc08
commit
6a48bbe08b
@@ -9,7 +9,6 @@
|
||||
[frontend.state :as state]
|
||||
[logseq.graph-parser.text :as text]
|
||||
[frontend.util :as util]
|
||||
[goog.object :as gobj]
|
||||
[reitit.frontend.easy :as rfe]))
|
||||
|
||||
(defn redirect!
|
||||
@@ -137,21 +136,21 @@
|
||||
(state/set-search-mode! search-mode))
|
||||
(state/pub-event! [:go/search]))
|
||||
|
||||
(defn sidebar-journals!
|
||||
[]
|
||||
(state/sidebar-add-block!
|
||||
(state/get-current-repo)
|
||||
(:db/id (db/get-page (date/today)))
|
||||
:page))
|
||||
|
||||
(defn go-to-journals!
|
||||
[e]
|
||||
(if (gobj/get e "shiftKey") ;TODO pretty sure this test should be sidebar.cljs
|
||||
(do
|
||||
(state/sidebar-add-block!
|
||||
(state/get-current-repo)
|
||||
(:db/id (db/get-page (date/today)))
|
||||
:page))
|
||||
(do
|
||||
(state/set-journals-length! 3)
|
||||
(let [route (if (state/custom-home-page?)
|
||||
:all-journals
|
||||
:home)]
|
||||
(redirect! {:to route}))
|
||||
(util/scroll-to-top))))
|
||||
[]
|
||||
(state/set-journals-length! 3)
|
||||
(let [route (if (state/custom-home-page?)
|
||||
:all-journals
|
||||
:home)]
|
||||
(redirect! {:to route}))
|
||||
(util/scroll-to-top))
|
||||
|
||||
(defn- redirect-to-file!
|
||||
[page]
|
||||
|
||||
Reference in New Issue
Block a user