aboutsummaryrefslogtreecommitdiff
path: root/src/frontend
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2024-06-04 22:03:37 +0200
committerMiguel Ángel Moreno <mail@migalmoreno.com>2024-06-04 22:03:37 +0200
commitcc6399b17fe651a2f5159a9bb6500df61dc413a7 (patch)
tree1be91a114e7f8f6346852ccae1ac7e1f08c8223e /src/frontend
parent7ed025ce3c80cc93f86d0a07cde15d487bcfb56c (diff)
feat: clean up paused button display logic
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/tubo/player/events.cljs9
1 files 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