Merge pull request #2636 from hadi-norouzi/feature/update_sub

Fix minimum update interval for subscription auto update
This commit is contained in:
2dust
2023-11-21 16:47:17 +08:00
committed by GitHub
@@ -77,8 +77,10 @@ class SettingsActivity : BaseActivity() {
autoUpdateInterval?.setOnPreferenceChangeListener { _, any ->
val nval = any as String
// It must be greater than 15 minutes because WorkManager couldn't run tasks under 15 minutes intervals
autoUpdateInterval?.summary =
if (TextUtils.isEmpty(nval) or (nval.toLong() < 1)) AppConfig.SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL else nval
if (TextUtils.isEmpty(nval) or (nval.toLong() < 15)) AppConfig.SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL else nval
configureUpdateTask(nval.toLong())
true
}