mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-09-11 14:43:13 +02:00
Using viewscope in about
This commit is contained in:
parent
0b4019a1cb
commit
f5b5be9e0b
@ -18,9 +18,7 @@ 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.view.openInBrowser
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import timber.log.Timber
|
||||
@ -44,11 +42,6 @@ class AboutController : SettingsController() {
|
||||
preferences.dateFormat()
|
||||
}
|
||||
|
||||
/**
|
||||
* The subscribtion service of the obtained release object
|
||||
*/
|
||||
private val scope = CoroutineScope(Job() + Dispatchers.IO)
|
||||
|
||||
private val isUpdaterEnabled = BuildConfig.INCLUDE_UPDATER
|
||||
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) = screen.apply {
|
||||
@ -157,7 +150,7 @@ class AboutController : SettingsController() {
|
||||
if (activity == null) return
|
||||
|
||||
activity?.toast(R.string.searching_for_updates)
|
||||
scope.launch {
|
||||
viewScope.launch {
|
||||
val result = try {
|
||||
updateChecker.checkForUpdate()
|
||||
} catch (error: Exception) {
|
||||
|
Loading…
Reference in New Issue
Block a user