Wait for root service to bind

This commit is contained in:
topjohnwu
2022-12-30 15:52:02 -08:00
committed by John Wu
parent 37b81ad1f6
commit 78a444d601
2 changed files with 15 additions and 4 deletions
@@ -35,7 +35,7 @@ class ModuleViewModel : AsyncLoadViewModel() {
var loading = true
private set(value) = set(value, field, { field = it }, BR.loading)
init {
private suspend fun init() = withContext(Dispatchers.IO) {
if (Info.env.isActive && LocalModule.loaded()) {
items.insertItem(InstallModule)
.insertList(itemsInstalled)
@@ -44,6 +44,9 @@ class ModuleViewModel : AsyncLoadViewModel() {
override suspend fun doLoadWork() {
loading = true
if (items.isEmpty()) {
init()
}
loadInstalled()
loading = false
loadUpdateInfo()