diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2022-12-30 01:01:26 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2022-12-30 01:01:26 +0100 |
commit | c3b4e2d87a2031c3499e49f47c39c7119adeb170 (patch) | |
tree | 0c0348410a6fd3afe8a6c5e479e5660c030a0a60 /src/frontend/tau/events.cljs | |
parent | 45694468ccea8219c47dfc470e9e5ef885f671bd (diff) |
feat(frontend): Add basic global player
Diffstat (limited to 'src/frontend/tau/events.cljs')
-rw-r--r-- | src/frontend/tau/events.cljs | 14 |
1 files changed, 12 insertions, 2 deletions
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 |