Skip to content

Native Android client for Spotify, built with Jetpack Compose

Revert "Fix launch crash: the lossless switch is read before the host's lazy prefs exist"

kota-zo5815227cc92b
diff --git a/base/host-android/src/main/kotlin/app/myspoti/host/android/WebPlayerHost.kt b/base/host-android/src/main/kotlin/app/myspoti/host/android/WebPlayerHost.kt
index 09aed183..9c18193b 100644
--- a/base/host-android/src/main/kotlin/app/myspoti/host/android/WebPlayerHost.kt
+++ b/base/host-android/src/main/kotlin/app/myspoti/host/android/WebPlayerHost.kt
@@ -277,9 +277,7 @@ class WebPlayerHost(private val context: Context) : BridgeHost {
it.install()
}
// Spotify lossless, when chosen: declared before the page's first script (see setLossless).
- // Read here, not through [roots]: the first view is made while the host is being built,
- // before that lazy property below is set (dev 3138 crashed at launch on it).
- losslessScript = if (context.getSharedPreferences("web_player", Context.MODE_PRIVATE).getBoolean(LOSSLESS_KEY, false)) declareLossless(this) else null
+ losslessScript = if (roots.getBoolean(LOSSLESS_KEY, false)) declareLossless(this) else null
val webView = this
cookies().apply {
setAcceptCookie(true)