aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/frontend/tubo/channel/events.cljs5
-rw-r--r--src/frontend/tubo/routes.cljs3
2 files changed, 7 insertions, 1 deletions
diff --git a/src/frontend/tubo/channel/events.cljs b/src/frontend/tubo/channel/events.cljs
index 3e529df..49ed26a 100644
--- a/src/frontend/tubo/channel/events.cljs
+++ b/src/frontend/tubo/channel/events.cljs
@@ -90,3 +90,8 @@
{:nextPage (js/encodeURIComponent next-page-url)})
:db
(assoc db :show-pagination-loading true)))))
+
+(rf/reg-event-db
+ :channel/reset
+ (fn [db _]
+ (assoc db :channel nil)))
diff --git a/src/frontend/tubo/routes.cljs b/src/frontend/tubo/routes.cljs
index 2086a27..8e72d09 100644
--- a/src/frontend/tubo/routes.cljs
+++ b/src/frontend/tubo/routes.cljs
@@ -36,7 +36,8 @@
:name :channel-page
:controllers [{:parameters {:query [:url]}
:start (fn [{{:keys [url]} :query}]
- (rf/dispatch [:channel/fetch-page url]))}]}]
+ (rf/dispatch [:channel/fetch-page url]))
+ :stop #(rf/dispatch [:channel/reset])}]}]
["/playlist"
{:view playlist/playlist
:name :playlist-page