Fixed multiple fetch tasks running at once

Disposing wouldn't help since the shell doesn't appear to handle concurrency well
This commit is contained in:
Viktor De Pasquale 2019-06-20 19:52:57 +02:00 committed by topjohnwu
parent b77c590910
commit 5dd677756f

View File

@ -53,7 +53,7 @@ class SuperuserViewModel(
}
fun updatePolicies() {
fetchTask?.dispose()
if (fetchTask?.isDisposed?.not() == true) return
fetchTask = appRepo.fetchAll()
.flattenAsFlowable { it }
.map { PolicyRvItem(it, it.applicationInfo.loadIcon(packageManager)) }