mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-10 01:35:09 +01:00
Fixed #357
This commit is contained in:
parent
e69b51accb
commit
7b9ee0d75b
@ -17,6 +17,7 @@ import eu.kanade.tachiyomi.data.updater.UpdaterService
|
||||
import eu.kanade.tachiyomi.ui.base.controller.DialogController
|
||||
import eu.kanade.tachiyomi.ui.main.ChangelogDialogController
|
||||
import eu.kanade.tachiyomi.util.lang.toTimestampString
|
||||
import eu.kanade.tachiyomi.util.system.isOnline
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@ -102,7 +103,13 @@ class AboutController : SettingsController() {
|
||||
else BuildConfig.VERSION_NAME
|
||||
|
||||
if (isUpdaterEnabled) {
|
||||
onClick { checkVersion() }
|
||||
onClick {
|
||||
if (activity!!.isOnline()) {
|
||||
checkVersion()
|
||||
} else {
|
||||
activity!!.toast(R.string.no_network_connection)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
preference {
|
||||
@ -134,9 +141,11 @@ class AboutController : SettingsController() {
|
||||
val result = try {
|
||||
updateChecker.checkForUpdate()
|
||||
} catch (error: Exception) {
|
||||
withContext(Dispatchers.Main) {
|
||||
activity?.toast(error.message)
|
||||
Timber.e(error)
|
||||
}
|
||||
}
|
||||
when (result) {
|
||||
is UpdateResult.NewUpdate<*> -> {
|
||||
val body = result.release.info
|
||||
|
Loading…
Reference in New Issue
Block a user