mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 19:27:25 +01:00
Always cancel library update task
This commit is contained in:
parent
4ef7b16925
commit
ea790faeb3
@ -57,12 +57,13 @@ class SettingsGeneralFragment : SettingsFragment(),
|
|||||||
.subscribe { updateColumnsSummary(it.first, it.second) }
|
.subscribe { updateColumnsSummary(it.first, it.second) }
|
||||||
|
|
||||||
updateInterval.setOnPreferenceChangeListener { preference, newValue ->
|
updateInterval.setOnPreferenceChangeListener { preference, newValue ->
|
||||||
val interval = (newValue as String).toInt()
|
// Always cancel the previous task, it seems that sometimes they are not updated.
|
||||||
if (interval > 0)
|
|
||||||
LibraryUpdateJob.setupTask(interval)
|
|
||||||
else
|
|
||||||
LibraryUpdateJob.cancelTask()
|
LibraryUpdateJob.cancelTask()
|
||||||
|
|
||||||
|
val interval = (newValue as String).toInt()
|
||||||
|
if (interval > 0) {
|
||||||
|
LibraryUpdateJob.setupTask(interval)
|
||||||
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user