Fix: Refresh updates list after update/install

This commit is contained in:
machiav3lli 2022-03-30 01:55:17 +02:00
parent 285f417967
commit 7f33d6efc7
2 changed files with 12 additions and 0 deletions

View File

@ -272,6 +272,9 @@ interface InstalledDao : BaseDao<Installed> {
installed.forEach { insertReplace(it) }
}
@get:Query("SELECT * FROM memory_installed")
val allLive: LiveData<List<Installed>>
@Query("SELECT * FROM memory_installed WHERE package_name = :packageName")
fun get(packageName: String): Installed?

View File

@ -99,6 +99,15 @@ class MainNavFragmentViewModelX(
}
}
}
if (secondarySource == Source.UPDATES) {
secondaryProducts.addSource(db.installedDao.allLive) {
viewModelScope.launch {
withContext(Dispatchers.IO) {
secondaryProducts.postValue(db.productDao.queryObject(secondaryRequest))
}
}
}
}
}
fun setSection(newSection: Section) {