From 275ec7ef7458770a8199b280d06b2d4de224ea80 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Sun, 18 Feb 2024 17:36:42 +0100 Subject: feat(frontend): remove unnecessary service-color from handlers --- src/frontend/tubo/events.cljs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/frontend') diff --git a/src/frontend/tubo/events.cljs b/src/frontend/tubo/events.cljs index 827dec5..1167048 100644 --- a/src/frontend/tubo/events.cljs +++ b/src/frontend/tubo/events.cljs @@ -379,10 +379,9 @@ (rf/reg-event-fx ::switch-to-audio-player [(rf/inject-cofx :store)] - (fn [{:keys [db store]} [_ stream service-color]] - (let [full-stream (conj {:service-color service-color} stream) - updated-db (update db :media-queue conj full-stream) - idx (.indexOf (:media-queue updated-db) full-stream)] + (fn [{:keys [db store]} [_ stream]] + (let [updated-db (update db :media-queue conj stream) + idx (.indexOf (:media-queue updated-db) stream)] {:db (-> updated-db (assoc :show-audio-player true)) :store (-> store @@ -393,14 +392,11 @@ (rf/reg-event-fx ::enqueue-related-streams [(rf/inject-cofx :store)] - (fn [{:keys [db store]} [_ streams service-color]] + (fn [{:keys [db store]} [_ streams]] {:db (assoc db :show-audio-player true) :store (assoc store :show-audio-player true) :fx (into [] (conj - (map #(identity [:dispatch - [::add-to-media-queue - (conj {:service-color service-color} %)]]) - streams) + (map #(identity [:dispatch [::add-to-media-queue %]]) streams) [:dispatch [::fetch-audio-player-stream (:url (first streams)) (count (:media-queue db)) (= (count (:media-queue db)) 0)]]))})) -- cgit v1.2.3