[DO NOT USE] Implement DownloadScreen part 4

This commit is contained in:
tarsin committed 2023-06-05 16:05:38 +08:00
1 parent 4e6210c1f8
commit 3b1beba570
2 files changed
+11 -1

No files matched your search

@@ -76,7 +76,7 @@ object Settings : DataStorePreferences(null) {
val meteredNetworkWarning by boolPref("cellular_network_warning", false)
var appLinkVerifyTip by boolPref("app_link_verify_tip", false)
var enabledSecurity by boolPref("enable_secure", false)
var mediaScan by boolPref(KEY_MEDIA_SCAN, false)
var mediaScan by boolPref(KEY_MEDIA_SCAN, false).observed { updateWhenKeepMediaStatusChanges() }
var hasDefaultDownloadLabel by boolPref("has_default_download_label", false)
var qSSaveProgress by boolPref("qs_save_progress", true)
var saveParseErrorBody by boolPref("save_parse_error_body", true)
@@ -2,6 +2,8 @@ package com.hippo.ehviewer
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.os.LocaleListCompat
import com.hippo.ehviewer.ui.keepNoMediaFileStatus
import eu.kanade.tachiyomi.util.lang.launchIO
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
@@ -19,3 +21,11 @@ fun updateWhenLocaleChanges() {
AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags(newValue))
}
}
fun updateWhenKeepMediaStatusChanges() {
collectScope.launchIO {
runCatching {
keepNoMediaFileStatus()
}
}
}