From 65941b3d420a0d919d3b0a6bf0f438fcc0e2f86a Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Fri, 30 Dec 2022 22:47:42 +0100 Subject: fix(frontend): Move route navigation logic to effect --- src/frontend/tau/routes.cljs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/frontend/tau/routes.cljs') diff --git a/src/frontend/tau/routes.cljs b/src/frontend/tau/routes.cljs index 8cb2beb..a5fb579 100644 --- a/src/frontend/tau/routes.cljs +++ b/src/frontend/tau/routes.cljs @@ -2,7 +2,6 @@ (:require [reitit.frontend :as ref] [reitit.frontend.easy :as rfe] - [reitit.frontend.controllers :as rfc] [re-frame.core :as rf] [tau.events :as events] [tau.views.channel :as channel] @@ -50,12 +49,9 @@ (defn on-navigate [new-match] - (let [old-match (rf/subscribe [:current-match])] - (rf/dispatch [::events/reset-page-scroll]) - (when new-match - (let [controllers (rfc/apply-controllers (:controllers @old-match) new-match) - match (assoc new-match :controllers controllers)] - (rf/dispatch [::events/navigated match]))))) + (rf/dispatch [::events/reset-page-scroll]) + (when new-match + (rf/dispatch [::events/navigated new-match]))) (defn start-routes! [] -- cgit v1.2.3