Skip to content

Commit

Permalink
fix pause play button state of record audio componend when sending ap…
Browse files Browse the repository at this point in the history
…p to background
  • Loading branch information
briansztamfater committed May 15, 2023
1 parent a263710 commit 9f6df6a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/quo2/components/record_audio/record_audio/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
reached-max-duration? (atom false)
touch-timestamp (atom nil)
disabled? (atom false)
app-state-listener (atom nil)
rec-options
(merge
audio/default-recorder-options
Expand Down Expand Up @@ -512,7 +513,13 @@
(on-init reset-recorder))
(when audio-file
(let [filename (last (string/split audio-file "/"))]
(reload-player filename)))))
(reload-player filename)))
(reset! app-state-listener
(.addEventListener rn/app-state
"change"
#(when (= % "background")
(reset! playing-audio? false))))
#(.remove @app-state-listener)))
[rn/view
{:style style/bar-container
:pointer-events :box-none}
Expand Down

0 comments on commit 9f6df6a

Please sign in to comment.