Commit 3c7ece16 authored by Viktor De Pasquale's avatar Viktor De Pasquale Committed by John Wu

Fixed not showing current version

Current version was not displaying under circumstances that involve loss of connection. Versions are displayed whether the device is connected or not.
parent 870efc49
......@@ -160,6 +160,15 @@ class HomeViewModel(
}
fun refresh() {
magiskCurrentVersion.value = if (magiskState.value != MagiskState.NOT_INSTALLED) {
version.format(Info.magiskVersionString, Info.magiskVersionCode)
} else {
""
}
managerCurrentVersion.value = version
.format(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)
magiskRepo.fetchUpdate()
.applyViewModel(this)
.doOnSubscribeUi {
......@@ -185,12 +194,6 @@ class HomeViewModel(
else -> MagiskState.UP_TO_DATE
}
magiskCurrentVersion.value = if (magiskState.value != MagiskState.NOT_INSTALLED) {
version.format(Info.magiskVersionString, Info.magiskVersionCode)
} else {
""
}
magiskLatestVersion.value = version
.format(Info.remote.magisk.version, Info.remote.magisk.versionCode)
......@@ -200,9 +203,6 @@ class HomeViewModel(
else -> MagiskState.UP_TO_DATE
}
managerCurrentVersion.value = version
.format(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)
managerLatestVersion.value = version
.format(Info.remote.app.version, Info.remote.app.versionCode)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment