From c3b4e2d87a2031c3499e49f47c39c7119adeb170 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Fri, 30 Dec 2022 01:01:26 +0100 Subject: feat(frontend): Add basic global player --- src/frontend/tau/events.cljs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/frontend/tau/events.cljs') diff --git a/src/frontend/tau/events.cljs b/src/frontend/tau/events.cljs index ed01467..24da7d0 100644 --- a/src/frontend/tau/events.cljs +++ b/src/frontend/tau/events.cljs @@ -155,11 +155,21 @@ :nextPage (js/encodeURIComponent next-page-url)}) :db (assoc db :show-pagination-loading true))))) +(rf/reg-event-db + ::change-global-stream + (fn [db [_ global-stream]] + (assoc db :global-stream global-stream))) + +(rf/reg-event-db + ::toggle-global-player + (fn [db _] + (assoc db :show-global-player (not (:show-global-player db))))) + (rf/reg-event-fx ::switch-to-global-player - (fn [{:keys [db]} [_ res]] + (fn [{:keys [db]} [_ global-stream]] {:db (assoc db :show-global-player true) - :fx [[:dispatch [::change-global-search res]]]})) + :fx [[:dispatch [::change-global-stream global-stream]]]})) (rf/reg-event-db ::load-services -- cgit v1.2.3