new version = null when checking version

This commit is contained in:
Bnyro 2022-07-21 15:27:26 +02:00
parent a2ce2ab74f
commit 2b2d133718
2 changed files with 12 additions and 10 deletions

View File

@ -16,8 +16,8 @@
}
],
"attributes": [],
"versionCode": 7,
"versionName": "0.2.5",
"versionCode": 14,
"versionName": "0.4.1",
"outputFile": "app-x86_64-release.apk"
},
{
@ -29,8 +29,8 @@
}
],
"attributes": [],
"versionCode": 7,
"versionName": "0.2.5",
"versionCode": 14,
"versionName": "0.4.1",
"outputFile": "app-x86-release.apk"
},
{
@ -42,8 +42,8 @@
}
],
"attributes": [],
"versionCode": 7,
"versionName": "0.2.5",
"versionCode": 14,
"versionName": "0.4.1",
"outputFile": "app-armeabi-v7a-release.apk"
},
{
@ -55,8 +55,8 @@
}
],
"attributes": [],
"versionCode": 7,
"versionName": "0.2.5",
"versionCode": 14,
"versionName": "0.4.1",
"outputFile": "app-arm64-v8a-release.apk"
}
],

View File

@ -1,6 +1,7 @@
package com.github.libretube.preferences
import android.os.Bundle
import android.util.Log
import androidx.activity.result.ActivityResultLauncher
import androidx.fragment.app.Fragment
import androidx.preference.Preference
@ -86,9 +87,10 @@ class MainSettings : PreferenceFragmentCompat() {
CoroutineScope(Dispatchers.IO).launch {
// check for update
val updateInfo = UpdateChecker.getLatestReleaseInfo()
if (updateInfo?.name != "" && BuildConfig.VERSION_NAME != updateInfo?.name) {
Log.e(TAG, updateInfo?.name.toString())
if (updateInfo?.name != null && BuildConfig.VERSION_NAME != updateInfo?.name) {
// show the UpdateAvailableDialog if there's an update available
val updateAvailableDialog = UpdateDialog(updateInfo!!)
val updateAvailableDialog = UpdateDialog(updateInfo)
updateAvailableDialog.show(childFragmentManager, "UpdateAvailableDialog")
} else {
// otherwise show the no update available snackBar