Skip to content

Commit 5134fe7

Browse files
authored
Skip audio state JS calls on blank page (#1696)
Avoids "resetAudioPlayState is not defined" error when WebView is displaying `about:blank`.
1 parent 0303f31 commit 5134fe7

File tree

1 file changed

+3
-0
lines changed
  • app/src/main/java/com/capyreader/app/ui/components

1 file changed

+3
-0
lines changed

app/src/main/java/com/capyreader/app/ui/components/WebView.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ class WebViewState(
202202
fun updateAudioPlayState(url: String?, isPlaying: Boolean) {
203203
currentAudioUrl = url
204204
isAudioPlaying = isPlaying
205+
if (htmlId == null) {
206+
return
207+
}
205208
webView.post {
206209
if (url != null) {
207210
val escapedUrl = url.replace("'", "\\'")

0 commit comments

Comments
 (0)