Skip to content

Commit

Permalink
Fixed not showing current version
Browse files Browse the repository at this point in the history
Current version was not displaying under circumstances that involve loss of connection. Versions are displayed whether the device is connected or not.
  • Loading branch information
diareuse authored and topjohnwu committed Aug 7, 2019
1 parent 870efc4 commit 3c7ece1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)

Expand All @@ -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)
}
Expand Down

0 comments on commit 3c7ece1

Please sign in to comment.