mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-10 05:05:08 +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.base.controller.DialogController
|
||||||
import eu.kanade.tachiyomi.ui.main.ChangelogDialogController
|
import eu.kanade.tachiyomi.ui.main.ChangelogDialogController
|
||||||
import eu.kanade.tachiyomi.util.lang.toTimestampString
|
import eu.kanade.tachiyomi.util.lang.toTimestampString
|
||||||
|
import eu.kanade.tachiyomi.util.system.isOnline
|
||||||
import eu.kanade.tachiyomi.util.system.toast
|
import eu.kanade.tachiyomi.util.system.toast
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
@ -102,7 +103,13 @@ class AboutController : SettingsController() {
|
|||||||
else BuildConfig.VERSION_NAME
|
else BuildConfig.VERSION_NAME
|
||||||
|
|
||||||
if (isUpdaterEnabled) {
|
if (isUpdaterEnabled) {
|
||||||
onClick { checkVersion() }
|
onClick {
|
||||||
|
if (activity!!.isOnline()) {
|
||||||
|
checkVersion()
|
||||||
|
} else {
|
||||||
|
activity!!.toast(R.string.no_network_connection)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
preference {
|
preference {
|
||||||
@ -134,8 +141,10 @@ class AboutController : SettingsController() {
|
|||||||
val result = try {
|
val result = try {
|
||||||
updateChecker.checkForUpdate()
|
updateChecker.checkForUpdate()
|
||||||
} catch (error: Exception) {
|
} catch (error: Exception) {
|
||||||
activity?.toast(error.message)
|
withContext(Dispatchers.Main) {
|
||||||
Timber.e(error)
|
activity?.toast(error.message)
|
||||||
|
Timber.e(error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
when (result) {
|
when (result) {
|
||||||
is UpdateResult.NewUpdate<*> -> {
|
is UpdateResult.NewUpdate<*> -> {
|
||||||
|
Loading…
Reference in New Issue
Block a user