mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
fix: calendar doesn't redirect to journal page
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
[frontend.db :as db]
|
||||
[frontend.db.conn :as db-conn]
|
||||
[frontend.handler.page :as page-handler]
|
||||
[frontend.handler.route :as route-handler]
|
||||
[frontend.handler.user :as user-handler]
|
||||
[frontend.mobile.util :as mobile-util]
|
||||
[frontend.state :as state]
|
||||
@@ -29,9 +30,9 @@
|
||||
(let [apply-date! (fn [date]
|
||||
(let [page-name (date/journal-name (gdate/Date. (js/Date. date)))]
|
||||
(if-let [journal (db/get-page page-name)]
|
||||
(mobile-state/open-block-modal! journal)
|
||||
(-> (page-handler/<create! page-name {:redirect? false})
|
||||
(p/then #(mobile-state/open-block-modal! (db/get-page page-name)))))))]
|
||||
(route-handler/redirect-to-page! (:block/uuid journal))
|
||||
(p/let [page (page-handler/<create! page-name {:redirect? false})]
|
||||
(route-handler/redirect-to-page! (:block/uuid page))))))]
|
||||
(-> (.showDatePicker mobile-util/ui-local)
|
||||
(p/then (fn [^js e] (some-> e (.-value) (apply-date!)))))))
|
||||
|
||||
|
||||
@@ -13,28 +13,6 @@
|
||||
(defn use-search-last-input-at []
|
||||
(r/use-atom *search-last-input-at))
|
||||
|
||||
(defonce *modal-blocks (atom []))
|
||||
(defonce *blocks-navigation-history (atom []))
|
||||
(defn open-block-modal!
|
||||
[block]
|
||||
(when (:db/id block)
|
||||
(reset! *modal-blocks [block])
|
||||
(when-not (= (:db/id block) (:db/id (last @*blocks-navigation-history)))
|
||||
(swap! *blocks-navigation-history conj block))))
|
||||
|
||||
(defn close-block-modal!
|
||||
"Close top block sheet"
|
||||
[]
|
||||
(reset! *modal-blocks [])
|
||||
(reset! *blocks-navigation-history []))
|
||||
|
||||
(defn pop-navigation-history!
|
||||
[]
|
||||
(when (seq @*blocks-navigation-history)
|
||||
(let [stack (swap! *blocks-navigation-history pop)]
|
||||
(when (seq stack)
|
||||
(reset! *modal-blocks [(last stack)])))))
|
||||
|
||||
(defonce *popup-data (atom nil))
|
||||
(defn set-popup!
|
||||
[data]
|
||||
|
||||
Reference in New Issue
Block a user