mirror of
https://github.com/openlibrecommunity/olcng.git
synced 2026-07-03 14:05:17 +02:00
feat(ui): add status messages to update check on startup
This commit is contained in:
@@ -646,11 +646,15 @@ class MainActivity : HelperBaseActivity(), NavigationView.OnNavigationItemSelect
|
||||
}
|
||||
|
||||
private fun checkForUpdatesOnStartup() {
|
||||
showStatus("Проверка обновлений...")
|
||||
lifecycleScope.launch {
|
||||
try {
|
||||
val result = UpdateCheckerManager.checkForUpdate(true)
|
||||
if (result.hasUpdate) {
|
||||
showStatus("Доступно обновление ${result.latestVersion}")
|
||||
showUpdateAvailableDialog(result)
|
||||
} else {
|
||||
showStatus("Обновлений нет")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(AppConfig.TAG, "Failed to check for updates on startup: ${e.message}")
|
||||
|
||||
Reference in New Issue
Block a user