summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
Diffstat (limited to 'android/src')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/dataproxy/AppVersionInfoCache.kt12
1 files changed, 7 insertions, 5 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/dataproxy/AppVersionInfoCache.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/dataproxy/AppVersionInfoCache.kt
index ebb490a5a4..4b578f9a9b 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/dataproxy/AppVersionInfoCache.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/dataproxy/AppVersionInfoCache.kt
@@ -19,10 +19,6 @@ class AppVersionInfoCache(
private val setUpJob = setUp()
- private val settingsListenerId = settingsListener.subscribe { settings ->
- showBetaReleases = settings.showBetaReleases
- }
-
private var appVersionInfo: AppVersionInfo? = null
set(value) {
synchronized(this) {
@@ -81,6 +77,12 @@ class AppVersionInfoCache(
var version: String? = null
private set
+ init {
+ settingsListener.subscribe(this) { settings ->
+ showBetaReleases = settings.showBetaReleases
+ }
+ }
+
fun onCreate() {
context.getSharedPreferences(LEGACY_SHARED_PREFERENCES, Context.MODE_PRIVATE)
.edit()
@@ -90,7 +92,7 @@ class AppVersionInfoCache(
fun onDestroy() {
setUpJob.cancel()
- settingsListener.unsubscribe(settingsListenerId)
+ settingsListener.unsubscribe(this)
daemon.onAppVersionInfoChange = null
}