diff --git a/src/main/frontend/components/views.cljs b/src/main/frontend/components/views.cljs index ba81e05844..ee4b0081f9 100644 --- a/src/main/frontend/components/views.cljs +++ b/src/main/frontend/components/views.cljs @@ -241,7 +241,7 @@ (state/exit-editing-and-set-selected-blocks! [cell]) (set-focus-timeout! (js/setTimeout #(.focus cell) 100))))) -(rum/defc ^:large-vars/cleanup-todo block-title +(rum/defc ^:large-vars/cleanup-todo block-title < rum/static "Used on table view" [block* {:keys [create-new-block width row property]}] (let [*ref (hooks/use-ref nil) diff --git a/src/main/frontend/handler/route.cljs b/src/main/frontend/handler/route.cljs index c8693877b1..b2cf35d030 100644 --- a/src/main/frontend/handler/route.cljs +++ b/src/main/frontend/handler/route.cljs @@ -20,13 +20,19 @@ [logseq.shui.ui :as shui] [reitit.frontend.easy :as rfe])) +(defonce *previous-route (atom nil)) (defn redirect! "If `push` is truthy, previous page will be left in history." [{:keys [to path-params query-params push] - :or {push true}}] - (shui/popup-hide!) - (let [route-fn (if push rfe/push-state rfe/replace-state)] - (route-fn to path-params query-params)) + :or {push true} + :as route}] + ;; avoid repeat routes + (when-not (= route @*previous-route) + (reset! *previous-route route) + (shui/popup-hide!) + (let [route-fn (if push rfe/push-state rfe/replace-state)] + (route-fn to path-params query-params))) + ;; force return nil for usage in render phase of React nil)