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