Merge pull request #2636 from hadi-norouzi/feature/update_sub
Fix minimum update interval for subscription auto update
This commit is contained in:
1 file changed
+3
-1
@@ -77,8 +77,10 @@ class SettingsActivity : BaseActivity() {
|
|||||||
|
|
||||||
autoUpdateInterval?.setOnPreferenceChangeListener { _, any ->
|
autoUpdateInterval?.setOnPreferenceChangeListener { _, any ->
|
||||||
val nval = any as String
|
val nval = any as String
|
||||||
|
|
||||||
|
// It must be greater than 15 minutes because WorkManager couldn't run tasks under 15 minutes intervals
|
||||||
autoUpdateInterval?.summary =
|
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())
|
configureUpdateTask(nval.toLong())
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user