mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 05:25:08 +01: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.isOnline
|
||||||
import eu.kanade.tachiyomi.util.system.toast
|
import eu.kanade.tachiyomi.util.system.toast
|
||||||
import eu.kanade.tachiyomi.util.view.openInBrowser
|
import eu.kanade.tachiyomi.util.view.openInBrowser
|
||||||
import kotlinx.coroutines.CoroutineScope
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
@ -44,11 +42,6 @@ class AboutController : SettingsController() {
|
|||||||
preferences.dateFormat()
|
preferences.dateFormat()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The subscribtion service of the obtained release object
|
|
||||||
*/
|
|
||||||
private val scope = CoroutineScope(Job() + Dispatchers.IO)
|
|
||||||
|
|
||||||
private val isUpdaterEnabled = BuildConfig.INCLUDE_UPDATER
|
private val isUpdaterEnabled = BuildConfig.INCLUDE_UPDATER
|
||||||
|
|
||||||
override fun setupPreferenceScreen(screen: PreferenceScreen) = screen.apply {
|
override fun setupPreferenceScreen(screen: PreferenceScreen) = screen.apply {
|
||||||
@ -157,7 +150,7 @@ class AboutController : SettingsController() {
|
|||||||
if (activity == null) return
|
if (activity == null) return
|
||||||
|
|
||||||
activity?.toast(R.string.searching_for_updates)
|
activity?.toast(R.string.searching_for_updates)
|
||||||
scope.launch {
|
viewScope.launch {
|
||||||
val result = try {
|
val result = try {
|
||||||
updateChecker.checkForUpdate()
|
updateChecker.checkForUpdate()
|
||||||
} catch (error: Exception) {
|
} catch (error: Exception) {
|
||||||
|
Loading…
Reference in New Issue
Block a user