fix minimum subscription update interval

This commit is contained in:
Hadi Norouzi
2023-11-20 21:25:35 +03:30
parent ff0bc6594d
commit 286ad34d94

View File

@@ -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
}