fix: alpha update message

This commit is contained in:
rebelonion 2024-04-14 23:30:52 -05:00
parent 126bc6134e
commit 4b413b78fe

View file

@ -126,9 +126,10 @@ object AppUpdater {
}
private fun compareVersion(version: String): Boolean {
if (BuildConfig.BUILD_TYPE == "debug" || BuildConfig.BUILD_TYPE == "alpha") {
return BuildConfig.VERSION_NAME != version
} else {
return when (BuildConfig.BUILD_TYPE) {
"debug" -> BuildConfig.VERSION_NAME != version
"alpha" -> false
else -> {
fun toDouble(list: List<String>): Double {
return list.mapIndexed { i: Int, s: String ->
when (i) {
@ -142,7 +143,8 @@ object AppUpdater {
val new = toDouble(version.split("."))
val curr = toDouble(BuildConfig.VERSION_NAME.split("."))
return new > curr
new > curr
}
}
}