Delete outdated policies when refresh

This commit is contained in:
vvb2060 2021-02-25 06:11:40 +08:00 committed by John Wu
parent ee0ec3fbfa
commit d05408c89f

View File

@ -55,6 +55,7 @@ class SuperuserViewModel(
}
state = State.LOADING
val (policies, diff) = withContext(Dispatchers.Default) {
db.deleteOutdated()
val policies = db.fetchAll {
PolicyRvItem(it, it.icon, this@SuperuserViewModel)
}.sortedWith(compareBy(