From cc6399b17fe651a2f5159a9bb6500df61dc413a7 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Tue, 4 Jun 2024 22:03:37 +0200 Subject: feat: clean up paused button display logic --- src/frontend/tubo/player/events.cljs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/frontend/tubo/player/events.cljs b/src/frontend/tubo/player/events.cljs index a0f4e3b..c41c290 100644 --- a/src/frontend/tubo/player/events.cljs +++ b/src/frontend/tubo/player/events.cljs @@ -63,8 +63,7 @@ [(rf/inject-cofx ::inject/sub [:player])] (fn [{:keys [db player]} [_ paused?]] {:pause! {:paused? paused? - :player player} - :db (assoc db :paused paused?)})) + :player player}})) (rf/reg-event-fx :main-player/pause @@ -79,7 +78,8 @@ [(rf/inject-cofx ::inject/sub [:elapsed-time]) (rf/inject-cofx ::inject/sub [:main-player])] (fn [{:keys [db elapsed-time main-player]}] - {:fx [[:dispatch [:background-player/seek @elapsed-time]] + {:fx [[:dispatch [:background-player/set-paused false]] + [:dispatch [:background-player/seek @elapsed-time]] (when (and (:main-player/ready db) @main-player) [:dispatch [:main-player/pause true]])]})) @@ -102,7 +102,8 @@ [(rf/inject-cofx ::inject/sub [:player]) (rf/inject-cofx ::inject/sub [:elapsed-time])] (fn [{:keys [db player elapsed-time]} _] - {:fx [[:dispatch [:background-player/pause false]] + {:fx [[:dispatch [:background-player/set-paused true]] + [:dispatch [:background-player/pause false]] [:dispatch [:player/change-volume (:volume-level db) player]]]})) (rf/reg-event-fx -- cgit v1.2.3