diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-12-06 14:48:46 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-12-06 21:20:25 +0000 |
| commit | 8ae63b1614f55d822812d401b59b619ccf528709 (patch) | |
| tree | 1fa6bbcdca3d5b3668fe90bc1997a9b2c8d17080 | |
| parent | c2eeaee5687a5bbeb7f71234ecfc86cbb72d9164 (diff) | |
| download | mullvadvpn-8ae63b1614f55d822812d401b59b619ccf528709.tar.xz mullvadvpn-8ae63b1614f55d822812d401b59b619ccf528709.zip | |
Manually override `isOutdated` field when needed
Happens when the app version info cache is stale. When the upgrade target
version is actually the current version the `isOutdated` value should be
set to `false`.
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/dataproxy/AppVersionInfoCache.kt | 12 |
1 files changed, 10 insertions, 2 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 347cffdb46..73195df86f 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/dataproxy/AppVersionInfoCache.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/dataproxy/AppVersionInfoCache.kt @@ -20,11 +20,19 @@ class AppVersionInfoCache(val parentActivity: MainActivity) { synchronized(this) { upgradeVersion = if (isStable) value?.latestStable else value?.latest - if (upgradeVersion == version) { + if (value != null && upgradeVersion == version) { upgradeVersion = null + + field = AppVersionInfo( + value.currentIsSupported, + /* currentIsOutdated = */ false, + value.latestStable, + value.latest + ) + } else { + field = value } - field = value onUpdate?.invoke() } } |
