mirror of https://github.com/logseq/logseq
fix: :current-page could be empty
parent
b0349a8511
commit
1d1d8877b6
|
@ -12,6 +12,7 @@
|
|||
[frontend.state :as state]
|
||||
[logseq.graph-parser.text :as text]
|
||||
[frontend.util :as util]
|
||||
[frontend.date :as date]
|
||||
[lambdaisland.glogi :as log]))
|
||||
|
||||
(defn resolve-input
|
||||
|
@ -28,8 +29,10 @@
|
|||
(= :tomorrow input)
|
||||
(date->int (t/plus (t/today) (t/days 1)))
|
||||
(= :current-page input)
|
||||
;; This sometimes runs when there isn't a current page e.g. :home route
|
||||
(some-> (state/get-current-page) string/lower-case)
|
||||
(some-> (or (state/get-current-page)
|
||||
(:page (state/get-default-home))
|
||||
(date/today)) string/lower-case)
|
||||
|
||||
(and (keyword? input)
|
||||
(util/safe-re-find #"^\d+d(-before)?$" (name input)))
|
||||
(let [input (name input)
|
||||
|
|
Loading…
Reference in New Issue