aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2024-02-01 21:43:56 +0100
committerMiguel Ángel Moreno <mail@migalmoreno.com>2024-02-01 21:43:56 +0100
commit976e834a34e2c1641545f60a592f2ca2bed56509 (patch)
treed75b54242c3cb534397692c697794e60060d1c4a
parent156421bc9b4bf8652edaddacf4a5eb7d95bc7a3e (diff)
feat(frontend): clean up audio player mount events
-rw-r--r--src/frontend/tubo/components/audio_player.cljs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/frontend/tubo/components/audio_player.cljs b/src/frontend/tubo/components/audio_player.cljs
index b8a0e57..40f05b1 100644
--- a/src/frontend/tubo/components/audio_player.cljs
+++ b/src/frontend/tubo/components/audio_player.cljs
@@ -18,9 +18,10 @@
{:display-name "AudioPlayer"
:component-did-mount
(fn [this]
+ (set! (.-onended (rdom/dom-node this))
+ #(rf/dispatch [::events/change-media-queue-pos (+ media-queue-pos 1)]))
(when stream
- (set! (.-src (rdom/dom-node this)) stream)
- (set! (.-onended @!player) #(rf/dispatch [::events/change-media-queue-pos (+ media-queue-pos 1)]))))
+ (set! (.-src (rdom/dom-node this)) stream)))
:reagent-render
(fn [!player]
(let [!elapsed-time @(rf/subscribe [:elapsed-time])