mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Using viewscope in about
This commit is contained in:
parent
0b4019a1cb
commit
f5b5be9e0b
1 changed files with 1 additions and 8 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue